From 725fd595b373ad6874d59b80b768f2ac4cd5c2c5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 31 Jan 2024 10:47:23 -0600 Subject: [PATCH] Update vm-shutdown.ps1 --- esxi-scripts/vm-shutdown.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esxi-scripts/vm-shutdown.ps1 b/esxi-scripts/vm-shutdown.ps1 index c815c0de..26d414cb 100755 --- a/esxi-scripts/vm-shutdown.ps1 +++ b/esxi-scripts/vm-shutdown.ps1 @@ -11,7 +11,7 @@ $vmhosts=$args[0].Split(",") Foreach ($vmhost in $vmhosts) { write-host $vmhost - & Get-VMHost | Where $_.Name -eq $vmhost | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} + Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} }