header image

where –not

Posted by: | May 15, 2018 Comments Off on where –not |

PowerShell v6.1 preview 2 has added the where –not option.

The option adds another parameter to the syntax

where-object <property name> <operator like parameter> <value>


Couple of examples of using the syntax

Get-Process | where CPU -gt 12

Get-Service | where Status -like ‘Stop*’


Use –Not when you’re looking for properties that aren’t set. For example

Get-Service | where -Not DependentServices


Get-Process | where -Not StartTime

under: PowerShell v6

Comments are closed.