Hi,
i have to extract the vms which have the se in centos and redhat, how can i create this condition, i have a script like this but the "and" is not recognized
$VmInfo = Get-VM | where{$_.Guest.State -eq "Running"} | where{($_.Guest.OSFullName -match "centos") or ($_.Guest.OSFullName -match "Red Hat")}
$VMS = ($VmInfo).Name
$VMS = $VMS | sort
can you help about the correct syntax ?
thank you
You could use the RegEx or ('|')
where{$_.Guest.State -eq "Running" -and $_.Guest.OSFullName -match "centos|Red Hat"}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You could use the RegEx or ('|')
where{$_.Guest.State -eq "Running" -and $_.Guest.OSFullName -match "centos|Red Hat"}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
that's ok
thank you