-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDev-Profile.ps1
25 lines (22 loc) · 911 Bytes
/
Dev-Profile.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
GOTOSCRIPT
$enviromentObj = Get-Content -Raw '.\enviroment-vars.json' | Out-String | ConvertFrom-Json
Pop-Location
$enviromentObj.enviroments |
ForEach-Object {
$currentEnv = $_;
[Environment]::SetEnvironmentVariable($currentEnv.name, $currentEnv.value, "User")
}
function GOTODEV {set-location $Env:DEVPATH}
function GOTOSPRINT {set-location $Env:SPRINTPATH}
function GOTOFAT {set-location $Env:FATPATH}
Write-Host "`nLocal dev enviroments loaded, available functions (GOTODEV,GOTOSPRINT, GOTOFAT)." -ForegroundColor Yellow
Write-Host "`nNow Loading Visual Studios enviroment variables..." -ForegroundColor Yellow
push-location $Env:VS2017PATH
cmd /c "VsDevCmd.bat&set" |
ForEach-Object {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
Pop-Location
Write-Host "`nVisual Studio 2017 Command Prompt variables set." -ForegroundColor Yellow