GlennJC / AL-Scripts

Developed Scripts for deploying various Labs using Automated-Lab
10 stars 3 forks source link

Mount-LabIsoImage supports PassThru #5

Closed raandree closed 6 years ago

raandree commented 6 years ago

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

The documentation has room for improvement: https://github.com/AutomatedLab/AutomatedLab/wiki/Mounting-Isos-On-Azure

GlennJC commented 6 years ago

Fixed.