Skip to content

Update-VMGpuPartitionDriver.ps1 ignores mount state #452

@ClumsyDerp

Description

@ClumsyDerp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions