Powershell: Resolve-Error -Last 2 => says the error is in Resolve-AZerror

Created on 8 Oct 2019  路  4Comments  路  Source: PowerShell/PowerShell

If you run the new Resolve-Error, and erroneously use "-Last 2", you get an error which incorrectly identifies the cmdlet as Resolve-AZError

Steps to reproduce

  1. Download Daily build 7.0.0-daily.20191008
    2, Type The following
Resolve-Error -Last 2

I would have expected to see the cmdlet with the error to be identified as Resolve-Error..

Actual behavior

PS [C:\foo> ]> Resolve-error -last 2
Resolve-AzError: A positional parameter cannot be found that accepts argument '2'.

Environment data

PS [C:\foo> ]> $PSVersiontable

Name                           Value
----                           -----
PSVersion                      7.0.0-daily.20191008
PSEdition                      Core
GitCommitId                    7.0.0-daily.20191008
OS                             Microsoft Windows 10.0.18995
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0, 6.1.0, 6.2.0, 7.0.0-daily.20191008}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Question Resolution-External

Most helpful comment

Az.Accounts module has the Resolve-AzError cmdlet and its alias Resolve-Error.

All 4 comments

Az.Accounts module has the Resolve-AzError cmdlet and its alias Resolve-Error.

@SteveL-MSFT might it be better to rename the command to Format-ErrorRecord or Show-ErrorRecord as has been suggested in the ErrorView RFC / PRs, to prevent confusion with the Az cmdlets?

@doctordns the Az module is not maintained by the PowerShell team.

Unfortunately, the Az module has Resolve-Error alias. Maybe that is a good reason to avoid Resolve-ErrorRecord, however, we did take rve alias :) cc @theJasonHelmick

So my bad!

But I do prefer the name is Format-ErrorRecord

Was this page helpful?
0 / 5 - 0 ratings