Added git sync script and fixed an issue in the

remove old snapshots script in the PowerActions folder
This commit is contained in:
Kamen Nikolov
2023-11-21 16:52:47 +02:00
parent 20871aeffa
commit ce06c5372b
2 changed files with 45 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ $vms = Get-VM -Location $cluster
foreach ($vm in $vms) {
$snaphostsToBeRemoved = Get-Snapshot -VM $vm | where {$_.Created -lt $date}
if ($null -ne $snaphostsToBeRemoved) {
Write-Host "Removing snapshots: " + $snaphostsToBeRemoved + " of VM: " + $vm
Write-Host "Removing snapshots: '$snaphostsToBeRemoved' of VM: '$vm'"
Remove-Snapshot $snaphostsToBeRemoved -Confirm:$false
}
}