Skip to content

Commit 882b0e8

Browse files
matt9ucciSean Wheeler
authored andcommitted
Fix the example of Format-Custom -DisplayError (#1849)
The example is a -DisplayError parameter example. But it uses -ShowError parameter.
1 parent 61cb77d commit 882b0e8

File tree

5 files changed

+56
-34
lines changed

5 files changed

+56
-34
lines changed

reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,19 @@ Accept wildcard characters: False
5656
```
5757
5858
### -DisplayError
59-
Displays errors at the command line.
60-
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Custom command, and the expressions do not appear to be working.
61-
The following shows an example of the results of adding the DisplayError parameter with an expression.
62-
63-
PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError
64-
DayOfWeek $_ / $null
65-
--------- ------------
66-
Wednesday #ERR
59+
Indicates that this cmdlet displays errors at the command line.
60+
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working.
61+
The following shows an example of the results of adding the **DisplayError** parameter with an expression.
62+
63+
```powershell
64+
PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError
65+
66+
class DateTime
67+
{
68+
DayOfWeek = Wednesday
69+
$_ / $null = #ERR
70+
}
71+
```
6772

6873
```yaml
6974
Type: SwitchParameter

reference/4.0/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,19 @@ Accept wildcard characters: False
6161
```
6262
6363
### -DisplayError
64-
Displays errors at the command line.
65-
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Custom command, and the expressions do not appear to be working.
66-
The following shows an example of the results of adding the DisplayError parameter with an expression.
67-
68-
PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError
69-
DayOfWeek $_ / $null
70-
--------- ------------
71-
Wednesday #ERR
64+
Indicates that this cmdlet displays errors at the command line.
65+
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working.
66+
The following shows an example of the results of adding the **DisplayError** parameter with an expression.
67+
68+
```powershell
69+
PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError
70+
71+
class DateTime
72+
{
73+
DayOfWeek = Wednesday
74+
$_ / $null = #ERR
75+
}
76+
```
7277

7378
```yaml
7479
Type: SwitchParameter

reference/5.0/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,18 @@ Accept wildcard characters: False
6262
6363
### -DisplayError
6464
Indicates that this cmdlet displays errors at the command line.
65-
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Custom** command, and the expressions do not appear to be working.
66-
The following shows an example of the results of adding the *DisplayError* parameter with an expression.
65+
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working.
66+
The following shows an example of the results of adding the **DisplayError** parameter with an expression.
6767

68-
`PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError`
68+
```powershell
69+
PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError
6970
70-
`DayOfWeek $_ / $null`
71-
`--------- ------------`
72-
`Wednesday #ERR`
71+
class DateTime
72+
{
73+
DayOfWeek = Wednesday
74+
$_ / $null = #ERR
75+
}
76+
```
7377

7478
```yaml
7579
Type: SwitchParameter

reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,18 @@ Accept wildcard characters: False
6262
6363
### -DisplayError
6464
Indicates that this cmdlet displays errors at the command line.
65-
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Custom** command, and the expressions do not appear to be working.
66-
The following shows an example of the results of adding the *DisplayError* parameter with an expression.
65+
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working.
66+
The following shows an example of the results of adding the **DisplayError** parameter with an expression.
6767

68-
`PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError`
68+
```powershell
69+
PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError
6970
70-
`DayOfWeek $_ / $null`
71-
`--------- ------------`
72-
`Wednesday #ERR`
71+
class DateTime
72+
{
73+
DayOfWeek = Wednesday
74+
$_ / $null = #ERR
75+
}
76+
```
7377

7478
```yaml
7579
Type: SwitchParameter

reference/6/Microsoft.PowerShell.Utility/Format-Custom.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ Accept wildcard characters: False
6363
6464
### -DisplayError
6565
Indicates that this cmdlet displays errors at the command line.
66-
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Custom** command, and the expressions do not appear to be working.
67-
The following shows an example of the results of adding the *DisplayError* parameter with an expression.
66+
This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working.
67+
The following shows an example of the results of adding the **DisplayError** parameter with an expression.
6868

69-
`PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError`
69+
```powershell
70+
PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError
7071
71-
`DayOfWeek $_ / $null`
72-
`--------- ------------`
73-
`Wednesday #ERR`
72+
class DateTime
73+
{
74+
DayOfWeek = Wednesday
75+
$_ / $null = #ERR
76+
}
77+
```
7478

7579
```yaml
7680
Type: SwitchParameter

0 commit comments

Comments
 (0)