I'm so freakin' close, I can smell it, but don't think my desk can handle anymore head banging.
$Cluster = Get-Cluster ClusterName
$DRS = $Cluster | get-drsrule | % {$_.VMIds}
$VMS = $Cluster | Get-VM | where {$_.Id -notmatch $DRS}
I've tried -notcontains, -inotcontains, inotmatch, etc. to no avail. Any help would be appreciated. Can't figure out how to get powershell to handle the array.
P.S. - "$VMS = $Cluster | Get-VM | where {$_.Id -notmatch $DRS[0]}" does work.
K. Chris Nakagaki (Zsoldier)
Original Post removed from my own stupidity...
When doing -notcontains, are you listing the source first?
$VMS = $Cluster | Get-VM | where {$DRS -notcontains $_.Id}
-Scott
________________________
Original Post removed from my own stupidity...
When doing -notcontains, are you listing the source first?
$VMS = $Cluster | Get-VM | where {$DRS -notcontains $_.Id}
-Scott
________________________