Wednesday, August 11, 2010

Visual Studio command prompt with Powershell

I updated my profile in .\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 to include VS2010 prompt:


function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}

#Set environment variables for Visual Studio Command Prompt
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 Command Prompt variables set." -ForegroundColor Yellow

Thursday, August 05, 2010

Good TFS! Bad WebDeploy!

Evil MsDeploy wiped out my SharePoint site that was used to support TFS projects. Luckily I am on TFS 2010, so eventually I managed to get the site back without doing some low-level XML editing. I have to admit Microsoft did a very good job in making TFS more manageable.

I wish the next version of WebDeploy will be safer...

Wednesday, August 04, 2010

Comma in Powershell

Mmm Learned today the hard way that comma should not be used to separate parameters. That is, instead of:
Encrypt-String "Alex", "089234kljhwsdf=", "98qasdlfkjhasdflkjh==
you should use
Encrypt-String "Alex" "089234kljhwsdf=" "98qasdlfkjhasdflkjh==

Great explanation here.