|
$certbytes | Set-Content -Encoding Byte -Path $pfxPath -ea Stop |
Change the line 424 to:
[System.IO.File]::WriteAllBytes($pfxPath, $certbytes)
Reason: At Least in Powershell 7 the parameter Encoding Byte is not Available as parameter of Set-Content.
Use the System.IO.File Class directly. :)