The Value part in the Filter is a RegEx expression, so you can do a 'not match' using a Regex expression.
Something like this, for example
Get-View -ViewType HostSystem -Property Name,Config.Product -Filter @{'Config.Product.FullName'='^((?!24585383).)+$'}
------------------------------
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
------------------------------
Original Message:
Sent: Mar 07, 2025 09:03 AM
From: mtrohde
Subject: Get-View filter for not equals?
In particular I am looking for any hosts that do not have a particular build number. I have come up with something to filter for the build number but -ne or ! do not work in place of the =. Any suggestions?
This is the one liner I am using to search for the build version.
Get-View -ViewType HostSystem -Property Name,Config.Product -Filter @{'Config.Product.FullName'='24585383'} | Sort-Object Name | Format-Table Name, @{L='Host Version & Build Version';E={$_.Config.Product.FullName}}
Michael