Skip to content
Discussion options

You must be logged in to vote

There's no single/automatic way of doing this unfortunately. The Get-Error cmdlet works by inserting the System.Management.Automation.ErrorRecord#PSExtendedError type name to the error object and PowerShell has a custom formatter set for that type name to do the manual string building to create this format under

private static IEnumerable<FormatViewDefinition> ViewsOf_System_Management_Automation_GetError()
{
yield return new FormatViewDefinition("GetErrorInstance",
CustomControl.Create()
.GroupByProperty("PSErrorIndex", l…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@beedell-roke
Comment options

@beedell-roke
Comment options

Answer selected by beedell-roke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants