Skip to content

Commit 7ad25c3

Browse files
committed
Set up PS environment for VS2012 and VS2013
1 parent fa40cc3 commit 7ad25c3

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

setup_ps_env_VS2012.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function Get-Batchfile ($file) {
2+
$cmd = "`"$file`" & set"
3+
cmd /c $cmd | Foreach-Object {
4+
$p, $v = $_.split('=')
5+
Set-Item -path env:$p -value $v
6+
}
7+
}
8+
9+
function VsVars32()
10+
{
11+
$vs110comntools = (Get-ChildItem env:VS110COMNTOOLS).Value
12+
$batchFile = [System.IO.Path]::Combine($vs110comntools, "vsvars32.bat")
13+
Get-Batchfile $BatchFile
14+
}
15+
16+
"Initializing Casablanca Powershell VS2012 Environment"
17+
18+
# get VS tools
19+
VsVars32
20+
21+
$Env:VisualStudioVersion = "11.0"
22+
$Env:DevToolsVersion = "110"

setup_ps_env_VS2013.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function Get-Batchfile ($file) {
2+
$cmd = "`"$file`" & set"
3+
cmd /c $cmd | Foreach-Object {
4+
$p, $v = $_.split('=')
5+
Set-Item -path env:$p -value $v
6+
}
7+
}
8+
9+
function VsVars32()
10+
{
11+
$vs110comntools = (Get-ChildItem env:VS120COMNTOOLS).Value
12+
$batchFile = [System.IO.Path]::Combine($vs120comntools, "vsvars32.bat")
13+
Get-Batchfile $BatchFile
14+
}
15+
16+
"Initializing Casablanca Powershell VS2013 Environment"
17+
18+
# get VS tools
19+
VsVars32
20+
21+
$Env:VisualStudioVersion = "12.0"
22+
$Env:DevToolsVersion = "120"

0 commit comments

Comments
 (0)