summaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows/helpers.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/windows/helpers.ps1')
-rw-r--r--coin/provisioning/common/windows/helpers.ps116
1 files changed, 16 insertions, 0 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1
index f6a9fd90..4248d0ed 100644
--- a/coin/provisioning/common/windows/helpers.ps1
+++ b/coin/provisioning/common/windows/helpers.ps1
@@ -127,3 +127,19 @@ function is64bitWinHost
return 0
}
}
+
+Function Execute-Command
+{
+ Param (
+ [string]$command
+ )
+ Try {
+ echo "Executing command '$command'..."
+ $process = Start-Process -FilePath "cmd" -ArgumentList "/c $command" -PassThru -Wait -WindowStyle Hidden
+ if ($process.ExitCode) {throw "Error running command: '$command'"}
+ }
+ Catch {
+ $_.Exception.Message
+ exit 1
+ }
+}