Fix VM name;Fix cmdlet param;Purge scratch folder
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -27,12 +27,12 @@ $ConnectVIServerSplat = @{
|
||||
Connect-VIServer @ConnectVIServerSplat | Out-Null
|
||||
|
||||
$GetVMSplat = @{
|
||||
VM = "$($VMName)*"
|
||||
Name = "$($VMName)*"
|
||||
ErrorAction = 'SilentlyContinue'
|
||||
}
|
||||
If ([boolean](Get-VM @GetVMSplat)) {
|
||||
$RemoveVMSplat = @{
|
||||
VM = "$($VMName)*"
|
||||
VM = Get-VM @GetVMSplat
|
||||
DeletePermanently = $True
|
||||
Confirm = $False
|
||||
ErrorAction = 'SilentlyContinue'
|
||||
@ -42,4 +42,10 @@ If ([boolean](Get-VM @GetVMSplat)) {
|
||||
|
||||
Disconnect-VIServer * -Confirm:$False
|
||||
|
||||
# Delete scratch folder contents
|
||||
$RemoveItemSplat = @{
|
||||
Path = '/scratch/*'
|
||||
Recurse = $True
|
||||
Force = $True
|
||||
Confirm = $False
|
||||
}
|
||||
Remote-Item @RemoveItemSplat
|
Reference in New Issue
Block a user