Skip to content

Fix ConciseView to show Activity instead of myCommand - #11007

Merged
Ilya (iSazonov) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:errorview-script
Nov 10, 2019
Merged

Ilya (iSazonov) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:errorview-script

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Nov 7, 2019 •

Copy link
Copy Markdown
Member

PR Summary

ConciseView shows MyCommand as the prefix to the error message, but for a scriptblock, MyCommand is the whole scriptblock. Fix is to use CategoryInfo.Activity if available first. Also handle case where it's a script function by seeing if it's a command and showing MyCommand in that case rather than the Activity.

Before and after
img

PR Context

PR Checklist

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 10, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Nov 10, 2019
@iSazonov
Ilya (iSazonov) merged commit 2a45ccc into PowerShell:master Nov 10, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the errorview-script branch November 11, 2019 17:06
@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…1007)

ConciseView shows MyCommand as the prefix to the error message, but for a scriptblock, MyCommand is the whole scriptblock. Fix is to use CategoryInfo.Activity if available first. Also handle case where it's a script function by seeing if it's a command and showing MyCommand in that case rather than the Activity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants