我正在使用 PowerShell Core v6.0.2,并尝试将字节数组写入文件。这在常规 PowerShell 中运行良好,但在 PowerShell Core 中失败
$jsonstr = Get-Content $inputfilename
$jsonfile = ConvertFrom-Json $jsonstr
$bytes = [Convert]::FromBase64String($jsonfile.data)
$outputfilename = "test.xlsx";
Add-Content -Path $outputfilename -Value $bytes -Encoding Byte
错误:
这是一个错误还是由于二进制排序问题而不能再使用 Byte ?