Skip to content

Commit 00a2675

Browse files
matt9ucciSean Wheeler
authored and
Sean Wheeler
committed
Update Example 2 in Get-Alias.md (ineffective Exclude) (#1935)
`-Exclude Get-*` is ineffective because there are no aliases that begin with `Get-`.
1 parent a0b2502 commit 00a2675

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ This command gets all aliases in the current session.
6666
The output shows the "\<alias\> -\> \<definition\>" format that was introduced in Windows PowerShell 3.0.
6767
This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames.
6868
### Example 2
69+
```powershell
70+
Get-Alias -Name gp*, sp* -Exclude *ps
6971
```
70-
PS C:\> Get-Alias -Name g*, s* -Exclude Get-*
71-
```
7272

73-
This command gets all aliases that begin with "g" or "s", except for aliases that begin with "get-".
73+
This command gets all aliases that begin with gp or sp, except for aliases that end with ps.
74+
7475
### Example 3
7576
```
7677
PS C:\> Get-Alias -Definition Get-ChildItem

reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ The output shows the "\<alias\> -\> \<definition\>" format that was introduced i
7070
This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames.
7171

7272
### Example 2
73-
```
74-
PS C:\> Get-Alias -Name g*, s* -Exclude Get-*
73+
```powershell
74+
Get-Alias -Name gp*, sp* -Exclude *ps
7575
```
7676

77-
This command gets all aliases that begin with "g" or "s", except for aliases that begin with "get-".
77+
This command gets all aliases that begin with gp or sp, except for aliases that end with ps.
7878

7979
### Example 3
8080
```

reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ The output shows the \<alias\> -\> \<definition\> format that was introduced in
7070
This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames.
7171

7272
### Example 2: Get aliases by name
73-
```
74-
PS C:\> Get-Alias -Name g*, s* -Exclude Get-*
73+
```powershell
74+
Get-Alias -Name gp*, sp* -Exclude *ps
7575
```
7676

77-
This command gets all aliases that begin with g or s, except for aliases that begin with Get-.
77+
This command gets all aliases that begin with gp or sp, except for aliases that end with ps.
7878

7979
### Example 3: Get aliases for a cmdlet
8080
```

reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ The output shows the \<alias\> -\> \<definition\> format that was introduced in
5959
This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames.
6060

6161
### Example 2: Get aliases by name
62-
```
63-
PS C:\> Get-Alias -Name g*, s* -Exclude Get-*
62+
```powershell
63+
Get-Alias -Name gp*, sp* -Exclude *ps
6464
```
6565

66-
This command gets all aliases that begin with g or s, except for aliases that begin with Get-.
66+
This command gets all aliases that begin with gp or sp, except for aliases that end with ps.
6767

6868
### Example 3: Get aliases for a cmdlet
6969
```

reference/6/Microsoft.PowerShell.Utility/Get-Alias.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ The output shows the \<alias\> -\> \<definition\> format that was introduced in
6161
This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames.
6262

6363
### Example 2: Get aliases by name
64-
```
65-
PS C:\> Get-Alias -Name g*, s* -Exclude Get-*
64+
```powershell
65+
Get-Alias -Name gp*, sp* -Exclude *ps
6666
```
6767

68-
This command gets all aliases that begin with g or s, except for aliases that begin with Get-.
68+
This command gets all aliases that begin with gp or sp, except for aliases that end with ps.
6969

7070
### Example 3: Get aliases for a cmdlet
7171
```

0 commit comments

Comments
 (0)