2 Replies Latest reply on Nov 12, 2009 5:55 AM by Zsoldier

    Omitting VM's associated with DRS Rules

    Zsoldier Expert
    vExpert

       

      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)

      http://tech.zsoldier.com