This commit is contained in:
2023-10-25 08:45:25 -05:00
parent ea70de6fbf
commit 5cc55c8ecf
6 changed files with 49 additions and 10 deletions

View File

@@ -4,7 +4,7 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*' -or $_.Name -like '*iSCSI2*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
Try{
$vm = Get-VM -Name $vmName -ErrorAction Stop
switch($vm.PowerState){