Skip to content
Snippets Groups Projects
Commit f4c18834 authored by calrama's avatar calrama
Browse files

Add powershell library for common functions

parent d2302085
No related branches found
No related tags found
No related merge requests found
...@@ -121,3 +121,4 @@ RUN python -m pip --no-cache-dir install --no-warn-script-location \ ...@@ -121,3 +121,4 @@ RUN python -m pip --no-cache-dir install --no-warn-script-location \
numpy \ numpy \
scipy \ scipy \
pandas pandas
COPY lib.ps1 C:/lib.ps1
#
# Sets up Visual Studio Development environment
#
function VSDevEnv {
pushd "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/Common7/Tools"
cmd /c "VsDevCmd.bat $args & set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
}
#
# Sets exit to error when the command fails
#
function Must-Run {
$command = $args[0]
$arguments = $args[1..($args.Length)]
& $command @arguments
if (!$?) {
$Host.SetShouldExit(1)
Write-Error "Exit code $LastExitCode while running $command $arguments"
Exit(1)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment