Hello,
I'm not too great with combining where statements in powercli. Do I have to create variables and then perform my Get-VM action?
Here is what I have, and it doesn't work. I assume because the Where-Object doesn't allow an additional Where statement that isn't related to Where-Object?
Connect-VIServer -Server xx.xxx.xx.xxx
Get-VM | Where (Where-Object {($_.ExtensionData.Guest.ToolsStatus -eq "toolsOk")} -and (Where Version -NE "V11"))
Obviously it is wrong, can someone help me out? Is it even possible?
Try like this
Get-VM | Where-Object {$_.ExtensionData.Guest.ToolsStatus -eq "toolsOk" -and $_.Version -NE "V11"}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
Get-VM | Where-Object {$_.ExtensionData.Guest.ToolsStatus -eq "toolsOk" -and $_.Version -NE "V11"}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference