Skip to content

Instantly share code, notes, and snippets.

function ConvertTo-PackedGuid {
<#
.SYNOPSIS
https://gist.github.com/MyITGuy/d3e039c5ec7865edefc157fcd625a20a
Converts a GUID string into a packed globally unique identifier (GUID) string.
.DESCRIPTION
Takes a GUID string and breaks it into 6 parts. It then loops through the first five parts and reversing the order. It loops through the sixth part and reversing the order of every 2 characters. It then joins the parts back together and returns a packed GUID string.
.EXAMPLE
ConvertTo-PackedGuid -Guid '{7C6F0282-3DCD-4A80-95AC-BB298E821C44}'