Skip to content

Commit

Permalink
header.ps1: Remove the -ErrorAction default parameter
Browse files Browse the repository at this point in the history
I don't think it's really needed now, and it was a bit ill-conceived from the start.
  • Loading branch information
MatejKafka committed May 31, 2024
1 parent 623db78 commit c3d065e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions app/Pog/lib/header.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
Set-StrictMode -Version 3
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop

# pass `-ErrorAction Stop` to all commands; this is a second line of defence
# after `$ErrorActionPreference` and ideally shouldn't be needed, but in some
# contexts (e.g. apparently when calling $PSCmdlet.WriteError), it is necessary
# to locally override $ErrorActionPreference
$script:PSDefaultParameterValues = @{
"*:ErrorAction" = [System.Management.Automation.ActionPreference]::Stop
}

# ensure that the Pog compiled library is loaded everywhere
if (-not (Test-Path Env:POG_DEBUG)) {
Import-Module $PSScriptRoot\..\lib_compiled\Pog.dll
} else {
Expand Down

0 comments on commit c3d065e

Please sign in to comment.