From 8ce3d0174eb25d6b48995106a7a62c663fd95bac Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 19 Oct 2018 00:07:58 -0400 Subject: ci: win: enable powershell's strict mode Give variables a default value to pass strict mode. $ErrorActionPreference defines the default behavior if a powershell command fails. If it's set to 'stop', then it aborts the script on the first unresolved error. This behavior extends to native programs like cmake but do not depend on it. https://github.com/PowerShell/PowerShell/issues/3996 --- ci/build.ps1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'ci') diff --git a/ci/build.ps1 b/ci/build.ps1 index c5e6ab7925..5b3eb4d27d 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -1,4 +1,5 @@ -Set-PSDebug -Trace 1 +$ErrorActionPreference = 'stop' +Set-PSDebug -Strict -Trace 1 $env:CONFIGURATION -match '^(?\w+)_(?32|64)(?:-(?