Update-VMGpuPartitionDriver.ps1 ignores mount state
The script isn't executing correctly for and throws plenty of errors. I'm currently in the process of debugging what's failing and potentially why.
At a bare minimum I've already noticed that the mount call is failing for reasons yet to be uncovered.
The script however doesn't care about an (un)successful mount and just continues to march on with no chance of success.
I've wrapped the $DriverLetter result in a check to prevent further mayhem on my end.
"Mounting Drive..."
$DriveLetter = (Mount-VHD -Path $VHD.Path -PassThru | Get-Disk | Get-Partition | Get-Volume | Where-Object {$_.DriveLetter} | ForEach-Object DriveLetter)
if ([string]::IsNullOrEmpty($DriveLetter)) {
Write-Output "VHD couldn't be mounted. Terminating."
return
} else {
Write-Output "Drive letter of mounted VHD drive is: $DriveLetter"
}
Without prematurely jumping out here $DiverLetter will be literally passed down to Add-VMGpuPartitionAdapterFiles.psm1 and every single copy command will naturally fail.
EDIT: As for the mounting failure, appears that VHD was mounted but not assigned a letter on mount. Manual assignment and setting DriveLetter correctly then caused all scripts to operate as expected.