Skip to content

Instantly share code, notes, and snippets.

@matthiasguentert
Last active December 3, 2021 13:42
Show Gist options
  • Save matthiasguentert/6488d320771003f7b499d5722b317426 to your computer and use it in GitHub Desktop.
Save matthiasguentert/6488d320771003f7b499d5722b317426 to your computer and use it in GitHub Desktop.
PowerShell Cheat Sheet

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment