I found these CLAUDE.md examples that help mitigate when claude or external tools are executed
ie: Cases where you can't just modify your profile
The problem is powerh
In the file $Profile.CurrentUserAllHosts add
| #requires -Modules PSParseHTML | |
| <# | |
| .link | |
| javascript answer: https://gist.github.com/ninmonkey/b59e33cec6765a2c782edaf5c4807b17 | |
| #> | |
| Import-Module PSParseHTML | |
| $url = 'https://tavex.pl/zloto/zlote-sztabki/page/1?filter%5Bweight%5D%5B0%5D=1&meta%5B0%5D=tax-gold%3Azlote-sztabki&sorting=recommended' | |
| $html ??= Invoke-WebRequest -url $Url -UseBasicParsing |
| function EditFunc { | |
| <# | |
| .SYNOPSIS | |
| Finds where a function is defined, opens it in vs code -- and jumps to the line number it starts on | |
| .example | |
| gcm prompt | EditFunc | |
| #> | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(ValueFromPipeline)] |
function Pow { param( $base, $pow ) [Math]::Pow( $base, $pow ) }
filter fPow { param( $Pow ) [Math]::Pow( $_, $pow ) }
filter IPow { param( $Base ) [Math]::Pow( $base, $_ ) }
function Csv { $input | Join-String -sep ', ' }3 Different interfaces
Pow 2 7 | filter EscapeCC { | |
| ($_)?.EnumerateRunes() | % { | |
| ($_.Value -le 32) ? [Text.Rune]( $_.Value + 0x2400 ) : $_ | |
| } | Join-String | |
| } | |
| "sdf `a sdjf hi world`t`n ${fg:#feaa99} more stuff `u{0} `r`n blah" | escapeCC | |
| # outputs: sdf␠␇␠sdjf␠hi␠world␉␊␠␛[38;2;254;170;153m␠more␠stuff␠␀␠␍␊␠blah |
| let | |
| startDate = DateTime.Date( DateTime.LocalNow() ), | |
| endingOffset = 1000, // in days | |
| endingOffsetDate = Date.AddDays( startDate, endingOffset ), | |
| allDays = List.Transform( | |
| { Number.From(startDate)..Number.From(endingOffsetDate) }, | |
| each { Date.From( _ ) } | |
| ), |
| <html><body> | |
| <table class="cols-3"> | |
| <tr> | |
| <th>Company</th> | |
| <th>Contact</th> | |
| <th>Country</th> | |
| </tr> | |
| <tr> | |
| <td>Alfreds Futterkiste</td> | |
| <td>Maria Anders</td> |
| let | |
| Path_Xlsx = "c:\data\workbook.xlsx", | |
| Summary = [ | |
| // [1] using "enter-data" saves a table as json like this | |
| b64_str = "i45WSkosUoqNBQA=", | |
| bytes = Binary.FromText( b64_str, BinaryEncoding.Base64), | |
| bytes_decompressed = Binary.Decompress( bytes, Compression.Deflate), | |
| final_json_str = Text.FromBinary( bytes_decompressed, TextEncoding.Utf8 ), | |
| // [2] converting some binary file to base64 |
| #Requires -Version 7 | |
| using namespace System.Collections.Generic | |
| using namespace System.Text | |
| using namespace System.Text.Json | |
| using namespace System.Text.Json.Serialization | |
| using namespace System.Linq | |
| $assembly = Add-type -AssemblyName System.Text.Json -PassThru -ea 'stop' | |
| <# |