Created
August 23, 2016 11:23
-
-
Save gravejester/b72cf245df3e6c4970435615ef0091e9 to your computer and use it in GitHub Desktop.
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 ConvertTo-ImmutableId { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Position = 0, ValuefromPipeline = $true, ValueFromPipelinebyPropertyName = $true)] | |
[Guid]$ObjectGUID | |
) | |
try { | |
$byteArray = $ObjectGUID.ToByteArray() | |
$immutableId = [Convert]::ToBase64String($byteArray) | |
Write-Output $immutableId | |
} | |
catch { | |
Write-Warning $_.Exception.Message | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment