Skip to content

Instantly share code, notes, and snippets.

@tabs-not-spaces
Last active December 9, 2019 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tabs-not-spaces/e970e6aceed34097d7b91d2034ed09a6 to your computer and use it in GitHub Desktop.
Save tabs-not-spaces/e970e6aceed34097d7b91d2034ed09a6 to your computer and use it in GitHub Desktop.
very simple decoder for scripts in graph
function ConvertFrom-Base64EncodedString {
[cmdletbinding()]
param (
[string]$encodedString
)
try {
$decodedOutput = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encodedString))
return $decodedOutput
}
catch {
Write-Warning $_.exception.message
}
}
function ConvertTo-Base64EncodedString {
[cmdletbinding()]
param (
[string]$inputString
)
try {
$EncodedString = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($inputString))
return $EncodedString
}
catch {
Write-Warning $_.exception.message
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment