Skip to content
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

Fixes #4479 - Added the NoEmphasis parameter to PS7 document #5066

Merged
merged 2 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
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
21 changes: 11 additions & 10 deletions reference/5.1/Microsoft.PowerShell.Utility/Select-String.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ Finds text in strings and files.
### File (Default)

```
Select-String [-Pattern] <string[]> [-Path] <string[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <string[]>] [-Exclude <string[]>] [-NotMatch] [-AllMatches] [-Encoding <string>]
Select-String [-Pattern] <String[]> [-Path] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches] [-Encoding <String>]
[-Context <Int32[]>] [<CommonParameters>]
```

### Object

```
Select-String [-Pattern] <string[]> -InputObject <psobject> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <string[]>] [-Exclude <string[]>] [-NotMatch] [-AllMatches] [-Encoding <string>]
Select-String -InputObject <PSObject> [-Pattern] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches] [-Encoding <String>]
[-Context <Int32[]>] [<CommonParameters>]
```

### LiteralFile

```
Select-String [-Pattern] <string[]> -LiteralPath <string[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <string[]>] [-Exclude <string[]>] [-NotMatch] [-AllMatches] [-Encoding <string>]
Select-String [-Pattern] <String[]> -LiteralPath <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches] [-Encoding <String>]
[-Context <Int32[]>] [<CommonParameters>]
```

Expand Down Expand Up @@ -469,7 +469,7 @@ Accept wildcard characters: False
### -List

Only the first instance of matching text is returned from each input file. This is the most
efficient way to retrieve a list files that have contents matching the regular expression.
efficient way to retrieve a list of files that have contents matching the regular expression.

By default, `Select-String` returns a **MatchInfo** object for each match it finds.

Expand Down Expand Up @@ -633,8 +633,9 @@ parameter. To specify the text to be searched, use the following criteria:
- If the text is stored in files, use the **Path** parameter to specify the path to the files.

By default, `Select-String` interprets the value of the **Pattern** parameter as a regular
expression. (For more information, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md).
You can use the **SimpleMatch** parameter to override the regular expression matching. The
expression. For more information, see
[about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md). You
can use the **SimpleMatch** parameter to override the regular expression matching. The
**SimpleMatch** parameter finds instances of the value of the **Pattern** parameter in the input.

The default output of `Select-String` is a **MatchInfo** object, which includes detailed information
Expand All @@ -647,7 +648,7 @@ If you don't need the information in the **MatchInfo** object, use the **Quiet**
instead of a **MatchInfo** object.

When matching phrases, `Select-String` uses the current culture that is set for the system. To find
the current culture, use the Get-Culture cmdlet.
the current culture, use the `Get-Culture` cmdlet.

To find the properties of a **MatchInfo** object, type the following command:

Expand Down
21 changes: 11 additions & 10 deletions reference/6/Microsoft.PowerShell.Utility/Select-String.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ Finds text in strings and files.
### File (Default)

```
Select-String [-Pattern] <string[]> [-Path] <string[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <string[]>] [-Exclude <string[]>] [-NotMatch] [-AllMatches]
Select-String [-Pattern] <String[]> [-Path] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### Object

```
Select-String [-Pattern] <string[]> -InputObject <psobject> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <string[]>] [-Exclude <string[]>] [-NotMatch] [-AllMatches]
Select-String -InputObject <PSObject> [-Pattern] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### LiteralFile

```
Select-String [-Pattern] <string[]> -LiteralPath <string[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <string[]>] [-Exclude <string[]>] [-NotMatch] [-AllMatches]
Select-String [-Pattern] <String[]> -LiteralPath <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

Expand Down Expand Up @@ -476,7 +476,7 @@ Accept wildcard characters: False
### -List

Only the first instance of matching text is returned from each input file. This is the most
efficient way to retrieve a list files that have contents matching the regular expression.
efficient way to retrieve a list of files that have contents matching the regular expression.

By default, `Select-String` returns a **MatchInfo** object for each match it finds.

Expand Down Expand Up @@ -640,8 +640,9 @@ parameter. To specify the text to be searched, use the following criteria:
- If the text is stored in files, use the **Path** parameter to specify the path to the files.

By default, `Select-String` interprets the value of the **Pattern** parameter as a regular
expression. (For more information, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md).
You can use the **SimpleMatch** parameter to override the regular expression matching. The
expression. For more information, see
[about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md). You
can use the **SimpleMatch** parameter to override the regular expression matching. The
**SimpleMatch** parameter finds instances of the value of the **Pattern** parameter in the input.

The default output of `Select-String` is a **MatchInfo** object, which includes detailed information
Expand All @@ -654,7 +655,7 @@ If you don't need the information in the **MatchInfo** object, use the **Quiet**
instead of a **MatchInfo** object.

When matching phrases, `Select-String` uses the current culture that is set for the system. To find
the current culture, use the Get-Culture cmdlet.
the current culture, use the `Get-Culture` cmdlet.

To find the properties of a **MatchInfo** object, type the following command:

Expand Down
68 changes: 47 additions & 21 deletions reference/7/Microsoft.PowerShell.Utility/Select-String.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,48 @@ Finds text in strings and files.

```
Select-String [-Pattern] <String[]> [-Path] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
[-List] [-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### ObjectRaw

```
Select-String -InputObject <PSObject> [-Pattern] <String[]> -Raw [-SimpleMatch] [-CaseSensitive]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
[-List] [-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### Object

```
Select-String -InputObject <PSObject> [-Pattern] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
[-List] [-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### FileRaw

```
Select-String [-Pattern] <String[]> [-Path] <String[]> -Raw [-SimpleMatch] [-CaseSensitive] [-List]
[-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches] [-Encoding <Encoding>]
[-Context <Int32[]>] [<CommonParameters>]
[-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### LiteralFileRaw
### LiteralFile

```
Select-String [-Pattern] <String[]> -LiteralPath <String[]> -Raw [-SimpleMatch] [-CaseSensitive]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
Select-String [-Pattern] <String[]> -LiteralPath <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

### LiteralFile
### LiteralFileRaw

```
Select-String [-Pattern] <String[]> -LiteralPath <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet]
[-List] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
Select-String [-Pattern] <String[]> -LiteralPath <String[]> -Raw [-SimpleMatch] [-CaseSensitive]
[-List] [-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches]
[-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -500,7 +500,7 @@ Accept wildcard characters: False
### -List

Only the first instance of matching text is returned from each input file. This is the most
efficient way to retrieve a list files that have contents matching the regular expression.
efficient way to retrieve a list of files that have contents matching the regular expression.

By default, `Select-String` returns a **MatchInfo** object for each match it finds.

Expand Down Expand Up @@ -535,6 +535,29 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -NoEmphasis

By default, `Select-String` highlights the string that matches the pattern you searched for with the
**Pattern** parameter. The **NoEmphasis** parameter disables the highlighting.

The emphasis uses negative colors based on your PowerShell background and text colors. For example,
if your PowerShell colors are a black background with white text. The emphasis is a white background
with black text.

This parameter was introduced in PowerShell 7.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

### -NotMatch

The **NotMatch** parameter finds text that doesn't match the specified pattern.
Expand Down Expand Up @@ -610,9 +633,11 @@ Accept wildcard characters: False
### -Raw

Causes the cmdlet to output only the matching strings, rather than **MatchInfo** objects. This is
the results in behavior that is the most similar to the Unix **grep** or Windows **findstr.exe**
the results in behavior that's the most similar to the Unix **grep** or Windows **findstr.exe**
commands.

This parameter was introduced in PowerShell 7.

```yaml
Type: SwitchParameter
Parameter Sets: ObjectRaw, FileRaw, LiteralFileRaw
Expand Down Expand Up @@ -683,8 +708,9 @@ parameter. To specify the text to be searched, use the following criteria:
- If the text is stored in files, use the **Path** parameter to specify the path to the files.

By default, `Select-String` interprets the value of the **Pattern** parameter as a regular
expression. (For more information, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md).
You can use the **SimpleMatch** parameter to override the regular expression matching. The
expression. For more information, see
[about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md). You
can use the **SimpleMatch** parameter to override the regular expression matching. The
**SimpleMatch** parameter finds instances of the value of the **Pattern** parameter in the input.

The default output of `Select-String` is a **MatchInfo** object, which includes detailed information
Expand All @@ -697,7 +723,7 @@ If you don't need the information in the **MatchInfo** object, use the **Quiet**
instead of a **MatchInfo** object.

When matching phrases, `Select-String` uses the current culture that is set for the system. To find
the current culture, use the Get-Culture cmdlet.
the current culture, use the `Get-Culture` cmdlet.

To find the properties of a **MatchInfo** object, type the following command:

Expand Down