Skip to content

Fix ConciseView for interactive advanced function writing error#13623

Merged
anmenaga merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:write-errorrecord
Sep 14, 2020
Merged

Fix ConciseView for interactive advanced function writing error#13623
anmenaga merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:write-errorrecord

Conversation

@SteveL-MSFT
Copy link
Copy Markdown
Member

@SteveL-MSFT SteveL-MSFT commented Sep 11, 2020

PR Summary

In the case where you interactively write to the console an advanced function that writes an error, that error doesn't get rendered. This is because in the ConciseView formatting, it doesn't correctly check if InvocationInfo.MyCommand.Name exists so it tries to find a command called $Null which fails.

Fix is to add check that InvocationInfo.MyCommand.Name exists.

PR Context

Fix #12727

PR Checklist

@kilasuit
Copy link
Copy Markdown
Collaborator

looks like this is a fix for #12727

@SteveL-MSFT
Copy link
Copy Markdown
Member Author

Thanks @kilasuit!

@anmenaga anmenaga added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 14, 2020
@anmenaga anmenaga merged commit d25d964 into PowerShell:master Sep 14, 2020
@iSazonov iSazonov added this to the 7.1.0-RC.1 milestone Sep 14, 2020
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.

Error hidden when anonymous command uses WriteError

5 participants