Commit de17c36a authored by Volker Hilsheimer's avatar Volker Hilsheimer
Browse files

Move Invoke-CmdScript into helper script

parent db1cfda6
. "c:\opt\minicoin\util\install_helper.ps1"
$packages = ("windows-sdk-10")
cd "$($env:SystemDrive)\ProgramData\Chocolatey\bin"
......@@ -14,18 +16,6 @@ ForEach ( $p in $packages ) { .\choco install --no-progress -y $p }
write-host "Updating PATH"
refreshenv
function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
Set-Item env:$varName -Value $varValue
}
}
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
# Without this, rc is no longer available after installing Windows 10 SDK
......
. "c:\opt\minicoin\util\install_helper.ps1"
$packages = ( "visualstudio2017buildtools",
"visualstudio2017-workload-vctools")
......@@ -11,19 +13,6 @@ ForEach ( $p in $packages ) { .\choco install --no-progress -y $p }
write-host "Updating PATH"
refreshenv
function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
Set-Item env:$varName -Value $varValue
}
}
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User)
......
......@@ -52,19 +52,6 @@ chocolatey feature disable -n=allowGlobalConfirmation
refreshenv
function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
Set-Item env:$varName -Value $varValue
}
}
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
[Environment]::SetEnvironmentVariable("PATH", $env:Path, 'user')
......
......@@ -25,3 +25,16 @@ function Run-KeepAlive {
Receive-Job $job
Remove-Job $job
}
function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
Set-Item env:$varName -Value $varValue
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment