Here is one to get the people going. Have you ever had an issue, where you tried to mount too many disks on your machine at one time, and ran out of driver letters? Well have no fear. It is a totally normal problem. Instead of mounting to drive letters... of which there are only 26. We can add access paths to partitions on the disk. You know what the best news is? The limit on access paths is totally crazy. I have once mounted 50 disks at the same time, and everything still seemed to work.
So here is the rub. This example is going to use a bunch of powershell cmdlets. But all of these are just wrappers around the root\microsoft\windows\storage CIM namespace. We could do this the badass way using only CIM, but it would be much longer, and I need something to write about tomorrow.
Anyway, this is what the code looks like.
raw
#
# Mount a virtual hard disk to a folder
#
function Mount-VHDToFolder
{
    [CmdLetBinding()]
    param
    (
        [Parameter(Mandatory=$true)][String]$Image,
        [Parameter(Mandatory=$true)][String]$MountFolder
    )
    process
    {
        try
        {
            # Gets a mounted disk image
            $mountedDisk = Mount-DiskImage -ImagePath $Image -NoDriveLetter -PassThru -ErrorAction Stop | Get-DiskImage
        }
        catch
        {
            Write-Error "Failed to mount disk"
            return
        }

        # Get all of the partitions
        $partitions = Get-Partition -DiskNumber $mountedDisk.Number

        foreach($partition in $partitions)
        {
            $partFolder = Join-Path $MountFolder $partition.PartitionNumber

            # Clean up this folder if it exists
            if(Test-Path $partFolder)
            {
                rmdir -Force $partFolder
            }

            # Make the new folder
            mkdir $partFolder | Out-Null

            try
            {
                # Add the access path for the disk
                Add-PartitionAccessPath -InputObject $partition -AccessPath $partFolder -ErrorAction Stop
            }
            catch
            {
                Write-Warning "Could not add access path '$($partFolder)' for partition '$($partition.PartitionNumber)'"
            }
        }
    }
}
                            
                        
This is going to create a folder for each partition number in the mount folder which you provide. It will try to add an access path for each partition. FYI, the reason I check if the folder exists, and delete it, is because AddAccessPath will fail if there is a broken symbolic link on the folder. AKA, you dismounted a disk which was using that folder as an access path without removing the access path first.
And there you have it! It is pretty simple really. Mounting the disk image gives us a MSFT_Disk cim object. We can use that disk to get all of the related MSFT_Partition cim objects. The MSFT_Partition object has a method called "AddAccessPath". Powershell wraps all of this stuff up for us super nicely so we won't need to mess with it.