Cardboard Iguana Security

Work with base64 encoding using PowerShell

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
Work with base64 encoding using PowerShell
Interactive graph
On this page
Work with base64 encoding using PowerShell