Skip to content

Instantly share code, notes, and snippets.

@JakeGinnivan
Created August 14, 2014 13:29
Show Gist options
  • Select an option

  • Save JakeGinnivan/afdc34427b9975ea9136 to your computer and use it in GitHub Desktop.

Select an option

Save JakeGinnivan/afdc34427b9975ea9136 to your computer and use it in GitHub Desktop.
Profile.ps1
cd c:\
# Load posh-git example profile
. 'C:\_code\posh-git-master\profile.example.ps1'
function Get-Batchfile ($file) {
$cmd = "`"$file`" & set"
cmd /c $cmd | Foreach-Object {
$p, $v = $_.split('=')
Set-Item -path env:$p -value $v
}
}
function Prune-Local-Branches() {
git branch --merged master | grep -v 'master$' | ForEach-Object { git branch -d $_.Trim() }
}
function VsVars32()
{
$vs120comntools = (Get-ChildItem env:VS120COMNTOOLS).Value
$batchFile = [System.IO.Path]::Combine($vs120comntools, "vsvars32.bat")
Get-Batchfile $BatchFile
}
"Initializing VS2013 Environment"
# get VS tools
VsVars32
# set VisualStudioVersion - this is set by vcvarsall.bat under VS 11 and is needed to correctly build
# on a machine with both Dev10 and Dev11 installed.
$Env:VisualStudioVersion = "11.0"
# set environment variable to select between Dev10 and Dev11 projects in the various dirs.proj
$Env:DevToolsVersion = "110"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment