-
Notifications
You must be signed in to change notification settings - Fork 0
/
LibVcVars.ps1
33 lines (28 loc) · 1014 Bytes
/
LibVcVars.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
26
27
28
29
30
31
32
33
function Get-Batchfile ($file) {
$cmd = "`"$file`" & set"
cmd /c $cmd | Foreach-Object {
$p, $v = $_.split('=')
Set-Item -path env:$p -value $v
}
}
function VsVars32($version = "10.0")
{
if (Test-Path "HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7")
{
$vcdirkey = Get-ItemProperty "HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7"
}
else
{
$vcdirkey = Get-ItemProperty "HKLM:SOFTWARE\Microsoft\VisualStudio\SxS\VC7"
}
$vcdir = Get-Member -Name "$version" -InputObject $vcdirkey
$vcdir = $vcdir.Definition.Split('=')[1]
$BatchFile = [System.IO.Path]::Combine($vcdir, "bin\vcvars32.bat")
Get-Batchfile $BatchFile
$global:WindowTitlePrefix = ("VS " + $version + " - ")
#Set-ConsoleIcon ($env:userprofile + "\utils\resources\vspowershell.ico")
}
#Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
# DotSource the Console Icon Stuff
#. ./Set-ConsoleIcon.ps1
#Pop-Location