Skip to content

Commit e97859d

Browse files
SimonWahlinSean Wheeler
authored andcommitted
Add -Not Feature to Where-Object (#2292)
Fix #2199
1 parent 72b311d commit e97859d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

reference/6/Microsoft.PowerShell.Core/Where-Object.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Selects objects from a collection based on their property values.
2020
Where-Object [-InputObject <PSObject>] [-Property] <String> [[-Value] <Object>] [-EQ] [<CommonParameters>]
2121
```
2222

23+
### NotSet
24+
```
25+
Where-Object [-Property] <string> -Not [-InputObject <psobject>] [<CommonParameters>]
26+
```
27+
2328
### ScriptBlockSet
2429
```
2530
Where-Object [-InputObject <PSObject>] [-FilterScript] <ScriptBlock> [<CommonParameters>]
@@ -854,6 +859,25 @@ Accept pipeline input: False
854859
Accept wildcard characters: False
855860
```
856861

862+
### -Not
863+
Indicates that this cmdlet gets objects if the property does not exist or has a value of null or false.
864+
865+
For example: `Get-Service | where -Not "DependentServices"`
866+
867+
This parameter was introduced in Windows PowerShell 6.1.
868+
869+
```yaml
870+
Type: SwitchParameter
871+
Parameter Sets: Not
872+
Aliases:
873+
874+
Required: True
875+
Position: Named
876+
Default value: None
877+
Accept pipeline input: False
878+
Accept wildcard characters: False
879+
```
880+
857881
### -NotContains
858882
Indicates that this cmdlet gets objects if none of the items in the property value is an exact match for the specified value.
859883

0 commit comments

Comments
 (0)