Skip to content

Instantly share code, notes, and snippets.

@gravejester
Created August 23, 2016 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gravejester/40b971e1f1612c17be412123b91df49f to your computer and use it in GitHub Desktop.
Save gravejester/40b971e1f1612c17be412123b91df49f to your computer and use it in GitHub Desktop.
function ConvertTo-GUID {
[CmdletBinding()]
param (
[Parameter(Position = 0, ValueFromPipeline = $true)]
[string] $ImmutableId
)
try {
$byteArray = [Convert]::FromBase64String($ImmutableId)
$newGuid = [Guid]::new($byteArray)
Write-Output $newGuid
}
catch {
Write-Warning $_.Exception.Message
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment