Skip to content

Commit 762e0c3

Browse files
SimonWahlinjoeyaiello
authored and
joeyaiello
committed
Add -Not Feature to Where-Object (#2292)
Fix #2199
1 parent cd8d158 commit 762e0c3

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
@@ -21,6 +21,11 @@ Selects objects from a collection based on their property values.
2121
Where-Object [-InputObject <PSObject>] [-Property] <String> [[-Value] <Object>] [-EQ] [<CommonParameters>]
2222
```
2323

24+
### NotSet
25+
```
26+
Where-Object [-Property] <string> -Not [-InputObject <psobject>] [<CommonParameters>]
27+
```
28+
2429
### ScriptBlockSet
2530

2631
```
@@ -925,6 +930,25 @@ Accept pipeline input: False
925930
Accept wildcard characters: False
926931
```
927932

933+
### -Not
934+
Indicates that this cmdlet gets objects if the property does not exist or has a value of null or false.
935+
936+
For example: `Get-Service | where -Not "DependentServices"`
937+
938+
This parameter was introduced in Windows PowerShell 6.1.
939+
940+
```yaml
941+
Type: SwitchParameter
942+
Parameter Sets: Not
943+
Aliases:
944+
945+
Required: True
946+
Position: Named
947+
Default value: None
948+
Accept pipeline input: False
949+
Accept wildcard characters: False
950+
```
951+
928952
### -NotContains
929953

930954
Indicates that this cmdlet gets objects if none of the items in the property value is an exact match for the specified value.

0 commit comments

Comments
 (0)