Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Modules
-
Reviewed
Description
Using of < input redirection causes the following issues as script passed line by line.
The script continue to run even if it faces the critical error which should make it fail immediately.
puppet code
exec { "configure_iis6_metabase": #
|
command => template('iis6_metabase/powershell/configure_iis6_metabase.ps1'),
|
unless => template('iis6_metabase/powershell/check_iis6_metabase.ps1'),
|
provider => powershell,
|
logoutput => true
|
}
|
Test №1:
test.ps1
$erroractionpreference = "stop"
|
throw "bla"
|
echo "test"
|
"exits with code 0 - wrong behavior"
Test №2:
$erroractionpreference = "stop"
|
throw "bla"
|
"exits with code 1 - correct behavior"
Test №3(all commands in one line):
$erroractionpreference = "stop"
|
throw "bla";echo "test"
|
"exits with code 0 - correct behavior"
Attachments
Issue Links
- relates to
-
MODULES-2634 PowerShell Module doesn't run template with try/catch
-
- Resolved
-