Skip to content

Add -Not Feature to Where-Object #2292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions reference/6/Microsoft.PowerShell.Core/Where-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Selects objects from a collection based on their property values.
Where-Object [-InputObject <PSObject>] [-Property] <String> [[-Value] <Object>] [-EQ] [<CommonParameters>]
```

### NotSet
```
Where-Object [-Property] <string> -Not [-InputObject <psobject>] [<CommonParameters>]
```

### ScriptBlockSet
```
Where-Object [-InputObject <PSObject>] [-FilterScript] <ScriptBlock> [<CommonParameters>]
Expand Down Expand Up @@ -854,6 +859,25 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Not
Indicates that this cmdlet gets objects if the property does not exist or has a value of null or false.

For example: `Get-Service | where -Not "DependentServices"`

This parameter was introduced in Windows PowerShell 6.1.

```yaml
Type: SwitchParameter
Parameter Sets: Not
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

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

Expand Down