Last active
December 9, 2019 23:19
-
-
Save tabs-not-spaces/e970e6aceed34097d7b91d2034ed09a6 to your computer and use it in GitHub Desktop.
very simple decoder for scripts in graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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