mirror of
https://github.com/jamesstringerparsec/Easy-GPU-PV.git
synced 2024-08-30 18:22:17 +00:00
Cleanup
This commit is contained in:
parent
eea81c5491
commit
c552b1817c
@ -68,34 +68,34 @@ foreach ($d in $drivers) {
|
||||
}
|
||||
|
||||
$VM = Get-VM -VMName "GPUP"
|
||||
$VHD = Get-VHD -VMId $VM.VMId
|
||||
|
||||
If ($VM.state -eq "Running") {
|
||||
[bool]$state_was_running = $true
|
||||
}
|
||||
[bool]$state_was_running = $true
|
||||
}
|
||||
|
||||
if ($VM.state -ne "Off"){
|
||||
"Attemping to shutdown VM..."
|
||||
Stop-VM -Name $VMName -Force
|
||||
}
|
||||
"Attemping to shutdown VM..."
|
||||
Stop-VM -Name $VMName -Force
|
||||
}
|
||||
|
||||
While ($VM.State -ne "Off") {
|
||||
Start-Sleep -s 3
|
||||
"Waiting for VM to shutdown - make sure there are no unsaved documents..."
|
||||
}
|
||||
|
||||
$VHD = Get-VHD -VMId $VM.VMId
|
||||
Start-Sleep -s 3
|
||||
"Waiting for VM to shutdown - make sure there are no unsaved documents..."
|
||||
}
|
||||
|
||||
"Mounting Drive..."
|
||||
$DriveLetter = (Mount-VHD -Path $VHD.Path -PassThru | Get-Disk | Get-Partition | Get-Volume | Where-Object {$_.DriveLetter} | ForEach-Object DriveLetter) + ":"
|
||||
|
||||
"Copying GPU Files - this could take a while..."
|
||||
|
||||
Add-VMGPUPartitionAdapterFiles -hostname $Hostname -DriveLetter $DriveLetter -GPUName $GPUName
|
||||
|
||||
"Dismounting Drive..."
|
||||
Dismount-VHD -Path $VHD.Path
|
||||
|
||||
If ($state_was_running){
|
||||
"Previous State was running so starting VM..."
|
||||
Start-VM $VMName
|
||||
}
|
||||
"Previous State was running so starting VM..."
|
||||
Start-VM $VMName
|
||||
}
|
||||
|
||||
"Done..."
|
Loading…
Reference in New Issue
Block a user