-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13dd1ee
commit 6745db5
Showing
6 changed files
with
43 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<# | ||
.DESCRIPTION | ||
Contain commonly used funcions. | ||
#> | ||
|
||
<# | ||
.DESCRIPTION | ||
Execute a process and throw an error if not exit correctly | ||
.OUTPUTS | ||
True if sucess. Throw error if failed | ||
#> | ||
function Start-ShellProcess { | ||
param ( | ||
[Parameter(Mandatory)] | ||
[string] $execName, | ||
[System.Collections.ArrayList] $params | ||
) | ||
|
||
$proc = Start-Process $execName -ArgumentList $params -Wait -PassThru | ||
|
||
if ($proc.ExitCode -ne 0) { | ||
# 如果非正常结束,就会报错 | ||
throw "Error executing $($repoURL) with param: $($cloneDst)" | ||
} | ||
|
||
return $true | ||
} | ||
Export-ModuleMember -Function Start-ShellProcess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters