Skip to content

Commit 0eda6b4

Browse files
committed
Make "Normal" the default in Format-Error
Instead of using whatever is already in $ErrorView
1 parent d945423 commit 0eda6b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ErrorView.ps1xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<ExpressionBinding>
1818
<ScriptBlock>
1919
<![CDATA[
20-
if ($formatter = Get-Command ConvertTo-$($global:ErrorView -replace "View")ErrorView -ListImported -ErrorAction Ignore -ParameterName InputObject -ParameterType [System.Management.Automation.ErrorRecord]) {
20+
if ($formatter = Get-Command "ConvertTo-$($global:ErrorView -replace "View")ErrorView" -ListImported -ErrorAction Ignore -ParameterName InputObject -ParameterType [System.Management.Automation.ErrorRecord]) {
2121
&@($formatter)[0] $_
2222
} else {
2323
ConvertTo-NormalErrorView $_

ErrorView.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Format-Error {
1818
Get-Command ConvertTo-*ErrorView -ListImported -ParameterName InputObject -ParameterType [System.Management.Automation.ErrorRecord]
1919
).Name -replace "ConvertTo-(.*)ErrorView",'$1' -like "*$($wordToComplete)*")
2020
})]
21-
$View = $ErrorView,
21+
$View = "Normal",
2222

2323
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
2424
[System.Management.Automation.ErrorRecord]$InputObject

0 commit comments

Comments
 (0)