fix todos

This commit is contained in:
Maxim Lobanov
2020-11-02 11:19:30 +03:00
parent cfaa7acb54
commit 3feabfdb52
2 changed files with 54 additions and 15 deletions

View File

@@ -83,3 +83,16 @@ function Invoke-RestMethodWithRetry {
)
Invoke-RestMethod $Url -MaximumRetryCount 10 -RetryIntervalSec 30
}
function Invoke-ExpressionWithValidation {
param(
[Parameter(Mandatory)]
[string]$Command
)
$output = Invoke-Expression -Command $Command
if ($LASTEXITCODE -ne 0) {
throw "Command '$Command' has finished with exit code $LASTEXITCODE"
}
return $output
}