forked from nightroman/PowerShellTraps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.test.ps1
More file actions
17 lines (14 loc) · 654 Bytes
/
.test.ps1
File metadata and controls
17 lines (14 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if ($env:GITHUB_ACTION) {return task GITHUB_ACTION}
$ErrorView = 'NormalView' #! v7
task Test-1.2.ThrowTerminatingError {
($r = Invoke-PowerShell -NoProfile -Command '$ErrorView = ''NormalView''; .\Test-1.2.ThrowTerminatingError.ps1')
assert (($r | Out-String) -clike '*invalid-input*\Test-1.2.ThrowTerminatingError.ps1:5 *Invoked!!!*')
}
task Test-2.2.Throw {
($r = try {.\Test-2.2.Throw.ps1} catch {$_})
assert (($r | Out-String) -clike "*invalid-input*\Test-2.1.Throw.ps1:5 *")
}
task Test-3.2.Write-Error {
($r = try {.\Test-3.2.Write-Error.ps1} catch {$_})
assert (($r | Out-String) -clike "*invalid-input*\Test-3.2.Write-Error.ps1:5 *")
}