PowershellでファイルをBase64エンコード/デコードする

$pathにファイルパスがあるとして

[Convert]::ToBase64String([System.IO.File]::ReadAllBytes($path))

$b64strにBase64文字列があり$pathに出力するとして

[System.IO.File]::WriteAllBytes($path, [Convert]::FromBase64String($b64str))


ConvertのSystemは省略しているのに、System.IO.Fileでは省略しないのは、趣味の問題。
Get-Contentコマンドレットを使わないのは、速度等の問題。