Skip to content

$ErrorActionPreference = 'stop' not showing the ERROR  #2576

@ohenrikh

Description

@ohenrikh

Hi
$ErrorActionPreference = 'stop'
in vscode causes the script to stop without throwing the ERROR code to Display when running with F5.

eg:
Script:
$ErrorActionPreference = 'stop'
write-WrongCommandLine "foo"
Write-Host 'Hello World'

Output vscode:
nothing, but the script stops as wanted
Output ISE and wanted
write-WrongCommandLine : The term 'write-WrongCommandLine' is not recognized as the name of a cmdle….
and the script stops

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions