うちの環境下では変換前のEncodingを指定するとうまく行かなかった。
Get-Content -Path "C:\Users\hoge\OneDrive - hoge\ドキュメント\hoge.txt" | Set-Content -Path "C:\Users\hoge\OneDrive - hoge\ドキュメント\hoge_utf8.txt" -Encoding UTF8 Get-Content -Path "C:\Users\hoge\OneDrive - hoge\ドキュメント\hoge.csv" | Set-Content -Path "C:\Users\hoge\OneDrive - hoge\ドキュメント\hoge_utf8.csv" -Encoding UTF8
これをタスクスケジューラで設定する場合は、この2つのコマンドを一緒に書いたps1ファイル作成し、セキュリティを一時的にバイパスして実行します。
プログラム/スクリプト
⇒powershell
引数の追加
⇒-ExecutionPolicy Bypass -File “c:\temp\hoge.ps1″
