-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathshared.ps1
More file actions
22 lines (18 loc) · 607 Bytes
/
shared.ps1
File metadata and controls
22 lines (18 loc) · 607 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ErrorActionPreference = 'Stop'
# PowerShell does not check the return code of native commands.
# There is a pending proposal to support this: https://github.com/PowerShell/PowerShell-RFC/pull/88/files
function Run-Command ($Command) {
<#
.SYNOPSIS
Run a native command.
.PARAMETER Command
The command to execute.
.EXAMPLE
The example below runs the "./bin/configlet hint ." command
Run-Command "./bin/configlet hint ."
#>
Invoke-Expression $Command
if ($Lastexitcode -ne 0) {
exit $Lastexitcode
}
}