PowerShellでBOM無しUTF8を簡単に出力する方法

2024年7月15日

通常では bomがついて 出力されてしまいます

バージョンの確認

$PSVersionTable 

新しいバージョンのパワーシェルPowerShellをインストール

Releases · PowerShell/PowerShell · GitHub

PowerShell-7.4.1-win-x64.msi

コマンド

pwsh -command "Get-Content D:/f.txt | Out-File D:/n.txt  -Encoding utf8NoBOM " 

Windows PowerShell 5.1 と PowerShell 7.x の相違点 – PowerShell | Microsoft Learn

https://learn.microsoft.com/ja-jp/powershell/module/

bat,PowerShell ,windows

Posted by eightban