PowerShellMafia/PowerSploit

PowerSploit/ScriptModification/Out-EncryptedScript.ps1

Aif4thah opened this issue · 0 comments

Hello,
when the 'Out-EncryptedScript.ps1' script is used from "powershell core 6.2.2" the parameter

"-Encoding Byte" at ligne 93 no longer exist:
[Byte[]] $scriptBytes = Get-Content -Encoding Byte -ReadCount 0 -Path $ScriptPath

it can be replaced with '-AsByteStream' :
[byte[]] $scriptBytes = Get-Content -AsByteStream -ReadCount 0 -Path $ScriptPath

For the moment, unfortunately the parameter 'AsByteStream' seem not working on a classic windows workstation updated with powershell 5.

Regards

PS: initial message error: Get-Content : Cannot process argument transformation on parameter 'Encoding'. 'Byte' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.