summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_exec_wrapper/library/test_rc_1.ps1
blob: a9879548fa99d80d3cf0a71eb3be99becb5f6181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!powershell

# This scenario needs to use Legacy, the same HadErrors won't be set if using
# Ansible.Basic
#Requires -Module Ansible.ModuleUtils.Legacy

# This will set `$ps.HadErrors` in the running pipeline but with no error
# record written. We are testing that it won't set the rc to 1 for this
# scenario.
try {
    Write-Error -Message err -ErrorAction Stop
}
catch {
    Exit-Json @{}
}

Fail-Json @{} "This should not be reached"