Skip to content

Instantly share code, notes, and snippets.

@jaredcatkinson
Created August 16, 2017 23:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jaredcatkinson/8da3c638e0612830deec5a6befa1164e to your computer and use it in GitHub Desktop.
Save jaredcatkinson/8da3c638e0612830deec5a6befa1164e to your computer and use it in GitHub Desktop.
function ConvertFrom-Base64
{
param
(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[string]
$Base64String
)
$stringBytes = [System.Convert]::FromBase64String($Base64String)
Write-Output ([System.Text.Encoding]::Unicode.GetString($stringBytes))
}
# ConvertFrom-Base64 -Base64String SABlAGwAbABvACAAVwBvAHIAbABkACEA
# 'SABlAGwAbABvACAAVwBvAHIAbABkACEA' | ConvertFrom-Base64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment