When the PassThru switch is used, an object is returned that also provide the assigned drive letter.
Then you do not need this code anymore:
#Get the Volume ID Assigned to the Removable Drive within the VM (will need this for the Import-MDTOperatingSystem Call)
$OSImageDriveLetter = Invoke-LabCommand -ComputerName $ComputerName -ScriptBlock {
Get-CimInstance Win32_LogicalDisk | Where-Object { $_.DriveType -eq 5} | Select-Object DeviceID
} -PassThru -NoDisplay
When the PassThru switch is used, an object is returned that also provide the assigned drive letter.
Then you do not need this code anymore:
The documentation has room for improvement: https://github.com/AutomatedLab/AutomatedLab/wiki/Mounting-Isos-On-Azure