You can now opt-in to a new built-in PowerShell tool in Claude Code as of v2.1.84 by setting the CLAUDE_CODE_USE_POWERSHELL_TOOL environment variable.
Until this release, Claude Code on Windows would use Git Bash to run commands, which has caused some weird issues for me in the past, such as running the roslyn-language-server dotnet tool, because the entrypoint is a .cmd file which can't be run in a git bash shell.
Now, Claude Code will see an additional tool called "PowerShell"
It doesn't replace the Bash tool, it just adds PowerShell, so you may find that the agent defaults to using Bash for most things unless you ask it to use PowerShell explicitly.
You can also add { "defaultShell": "powershell" } to your settings.json file to make !commands run in PowerShell. This means you can now run cmdlets directly. For example: ! Write-Host "Hello" now works. hello world
Created a small PowerShell scripts to split up MKV files by chapters. I wanted to avoid downloading yet another tool (handbrake or MKVToolNix) and I like the idea that I can use ffmpeg to do everything. For context, I have a DVD of Weird Al's ultimate music video collection that I got in middle school that I want available in Plex. I used MakeMKV to rip the DVD but all the music videos are in a single file, separated by chapters.
I ran into an issue using llm today where I was unable to save a response to a file using a pipe
llm llm logs -n 1 | Out-File response.txt
This would give me the error "UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 2831: character maps to <undefined>"
If you set the "PYTHONIOENCODING" environment variable to "utf8", it will fix the issue. This is because Python's default encoding is ASCII. Since the last response I got back from the model contained a non-ASCII character, this error was thrown.
So now, in my PowerShell profile, I've added a line to set the default to utf8, which fixes the issue.