Skip to content

No Error Displayed When $ErrorView Set to ConciseView #12191

@mattmcnabb

Description

@mattmcnabb

In PS7 with $ErrorView set to ConciseView a custom function in a script module does not display an error, but an error is recorded in $Error. Changing to NormalView fixes this issue. I have tested the same command in VS Code's Integrated Terminal running PS7 with ConciseView and an error is output as expected. I can't explain why this works differently based on the host.

image

The error itself is coming from Invoke-RestMethod which is reaching out to an Office 365 REST API. I don't see the same behavior with built in commands.


Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions