Monthly Archives: June 2012

Adding the Visual Studio 2010 Command Prompt variables to your PowerShell profile

If you add the following to your PowerShell profile then you’ll have access to all the commands only normally available by opening the Visual Studio 2010 Command Prompt:

# Set environment variables for Visual Studio Command Prompt
# Based on:
pushd 'c:\Program Files (x86)\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])"
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow

Your PowerShell profile will be somewhere like this:



I’d not come across this until today, when I was having problems installing some printer drivers. It lets you list and remove printer drivers very easily.

Just run this: printmanagement.msc