ファイルを読み込む
Get-Content
テキストファイルをフィールドに読み込む。UTF-8
フィールド設定 [SMPS::Result; SMPS_Exe( "Get-Content -Encoding UTF8 \"D:\FILE.txt\"" )]
テキストファイルをフィールドに読み込む。SHIFT-JIS
フィールド設定 [SMPS::Result; SMPS_Exe( "Get-Content -Encoding Default \"D:\FILE.txt\"" )]
System.IO.StreamReader
テキストファイルをフィールドに読み込む。euc-jp
フィールド設定 [SMPS::Result; SMPS_Exe(
$filePath='D:\FILE.txt';
$sr = New-Object System.IO.StreamReader( $filePath , [System.Text.Encoding]::GetEncoding("euc-jp"));
$content=$sr.ReadToEnd();
$sr.Close();
$content;
)]
Encoding クラス (System.Text) :
https://msdn.microsoft.com/ja-jp/library/system.text.encoding(v=vs.110).aspx