Skip to content

Instantly share code, notes, and snippets.

@awright18
Created February 3, 2017 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awright18/33176776a28747fb7e3c2c88a61524cd to your computer and use it in GitHub Desktop.
Save awright18/33176776a28747fb7e3c2c88a61524cd to your computer and use it in GitHub Desktop.
Powershell Profile wiht VSVars already set
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