Encode a command to base64 in PowerShell:
$Text = "$ONE_LINE_POWERSHELL_COMMAND"
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text)
$EncodedText = [Convert]::ToBase64String($Bytes)
Run this using:
powershell.exe -enc $EncodedText
Encode a command to base64 in PowerShell:
$Text = "$ONE_LINE_POWERSHELL_COMMAND"
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text)
$EncodedText = [Convert]::ToBase64String($Bytes)
Run this using:
powershell.exe -enc $EncodedText