Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Saturday, October 1, 2016 12:10 PM
I've found a number of posts converting a GUID string to Hex but not the other way round. I'm looking to convert:
3baa84f2a56fb246adf5e3b9ddfd03b9
to
f284aa3b-6fa5-46b2-adf5-e3b9ddfd03b9
All replies (1)
Saturday, October 1, 2016 2:19 PM âś…Answered
Found out that it's just a matter of re-ordering:
$oct = "3baa84f2a56fb246adf5e3b9ddfd03b9"
$oct1 = $oct.substring(0,2)
$oct2 = $oct.substring(2,2)
$oct3 = $oct.substring(4,2)
$oct4 = $oct.substring(6,2)
$oct5 = $oct.substring(8,2)
$oct6 = $oct.substring(10,2)
$oct7 = $oct.substring(12,2)
$oct8 = $oct.substring(14,2)
$oct9 = $oct.substring(16,4)
$oct10 = $oct.substring(20,12)
$strOut = "$oct4" + "$oct3" + "$oct2" + "$oct1" + "-" + "$oct6" + "$oct5" + "-" + "$oct8" + "$oct7" + "-" + "$oct9" + "-" + "$oct10"
write-host $strOut