且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Powershell解码base64

更新时间:2023-02-11 11:23:15

好了,我可以使用它了.谁知道默认情况下Out-File被重新编码为Unicode?通过执行以下操作来解决:

Well I got it working. Who knew Out-File re-encoded to Unicode by default? Solved by doing the following:

$file = "C:\input.txt"
$data = Get-Content $file
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($data)) | Out-File -Encoding "ASCII" out.html