Cheat Sheet - PowerShell

Cheat Sheet - PowerShell

Base64 Encode String

$input = "Foobar­čĄ¬"
$byteString = [System.Text.Encoding]::UTF8.GetBytes($input)
$base64String = [System.Convert]::ToBase64String($byteString)

Base64 Decode String

$input = "Rm9vYmFy8J+kqg=="
$byteString = [System.Convert]::FromBase64String($input)
$text = [System.Text.Encoding]::UTF8.GetString($byteString)