PowerShellMafia / PowerSploit

PowerSploit - A PowerShell Post-Exploitation Framework
Other
11.68k stars 4.59k forks source link

PowerSploit/ScriptModification/Out-EncryptedScript.ps1 #334

Open Aif4thah opened 4 years ago

Aif4thah commented 4 years ago

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.