File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787 Write-PSFMessage - Message " Vhd is already mounted" - Level Warning
8888
8989 # retrieve the specific disk
90- $disk = $disks | Where-Object { $_ . Location -eq $Path }
90+ $disk = $disks | Where-Object Location -eq $Path
9191 }
9292 else {
93- if ($PSCmdlet.ShouldProcess ($disk , " Mounting disk" )) {
93+ if ($PSCmdlet.ShouldProcess (" Mounting disk" )) {
9494 # Mount the vhd
9595 try {
9696 Write-PSFMessage - Message " Mounting disk $disk " - Level Verbose
9797
98- $disk = Mount-VHD - Path $Path - PassThru | Get-Disk
98+ # $disk = Mount-VHD -Path $Path -PassThru | Get-Disk
99+ # Mount the disk
100+ Mount-DiskImage - ImagePath $Path
101+
102+ # Get the disk
103+ $disk = Get-Disk | Where-Object Location -eq $Path
99104 }
100105 catch {
101106 Stop-PSFFunction - Message " Couldn't mount vhd" - Target $Path - ErrorRecord $_ - Continue
123128 }
124129 catch {
125130 # Dismount the drive
126- Dismount-VHD - Path $Path
131+ # Dismount-VHD -Path $Path
132+ Dismount-DiskImage - DiskImage $Path
127133
128134 Stop-PSFFunction - Message " Couldn't create the partition" - Target $disk - ErrorRecord $_ - Continue
129135 }
You can’t perform that action at this time.
0 commit comments