Created
February 3, 2017 19:50
-
-
Save awright18/33176776a28747fb7e3c2c88a61524cd to your computer and use it in GitHub Desktop.
Powershell Profile wiht VSVars already set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "14.0") | |
{ | |
<# $key = "HKLM:SOFTWARE\Microsoft\VisualStudio\" + $version | |
$VsKey = get-ItemProperty $key | |
$VsInstallPath = [System.IO.Path]::GetDirectoryName($VsKey.InstallDir) | |
$VsToolsDir = [System.IO.Path]::GetDirectoryName($VsInstallPath) | |
$VsToolsDir = [System.IO.Path]::Combine($VsToolsDir, "Tools") | |
$BatchFile = [System.IO.Path]::Combine($VsToolsDir, "vsvars32.bat")#> | |
$BatchFile = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat" | |
Get-Batchfile $BatchFile | |
[System.Console]::Title = "Visual Studio " + $version + " Windows Powershell" | |
Set-ConsoleIcon "C:\users\adam.wright\documents\WindowsPowershell\icons\vspowershell.ico" | |
} | |
VsVars32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment