Admin posted on October 25, 2011 13:08

Finally decided today that I no longer want to use the DOS command prompt, PowerShell is the way to go for everything!  But when I do use the VS DOS prompt it's normally because I want to use msbuild which means setting the correct envionment path.  A quick Google brings up some samples so I "lifted" one from here and changed it for VS 2010.

In PowerShell locate your profile:

  notepad $profile  (if you get prompted to create the file because you don't have a profile then click yes to create it)

Now here's the contents of Microsoft.PowerShell_profile.ps1:

 pushd 'C:\Program Files\Microsoft Visual Studio 10.0\vc'  
 cmd /c “vcvarsall.bat&set” |  
 foreach {  
  if ($_ -match “=”) {  
   $v = $_.split(“=”); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"  
  }  
 }  
 popd  
 write-host "`nVisual Studio 2010 PowerShell Prompt" -ForegroundColor Yellow  

Open up PowerShell and all of the VS commands are availble!...Good bye DOS!!


Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

«  May 2012  »
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
View posts in large calendar

Recent Comments

Banners

Theme Grabber
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Dan Gibbons .Net Developer