Real World Webcast Series for TFS 2010

I and a few coworkers are running a twice monthly web series starting February 10th.  This series will touch on the opportunities we’ve been involved in to ease real world situations.

If you are working with Team Foundation Server 2010 and are interested in making your life a little easier I invite you to come listen to what I and others have to say.  We’ll do everything we can to keep the schedule tight to 1 hour, but we are always available offline.

Automating Team Foundation Server with PowerShell Feb 10th, 12pm EST

System administration can be slow and inconsistent when performed manually, or quick and easy when automated. Learn to use PowerShell with TFS to script away that wasted time.

 

Continuous Deployment with Team Build and MSDeploy Feb 24th, 12pm EST

Caffeine, pizza, and anxiety are regular tools for a production deployment. Watch and learn how Team Foundation Build 2010 and MSDeploy can turn the last hurdle of software development into a moment of Zen.

 

Planning and Executing Manual Tests with Visual Studio Test Professional 2010 Mar 10th, 12pm EST

Visual Studio Test Professional 2010 makes a real impact on software quality. It’s an integrated testing solution that delivers a complete plan-test-track workflow. It allows the user to quickly identify quality-related bugs and easily report them with rich, actionable information. In this session, we’ll review test planning and manual testing with Visual Studio Test Professional 2010.

PowerShell Profile on Roaming Profile

NOTE: Impatience just leads to frustration.

When I first starting playing with PowerShell here at the office, I was all excited to start adding little cmdlets to my personal profile and add to my stellar productivity (tongue firmly planted in check).  This would hopefully reduce the net loss incurred by my learning PowerShell in the first place. 

So I took the first step and created my empty profile:

ps> notepad $profile

and added a nice little cmdlet to send email.  This will replace that exe tool I’ve always used to send emails in batch files or just whenever I need to at the command prompt.

$defaultSendMailHost = “emcrs71”
$defaultSendMailFrom = email@email.com

function send-mail( [string] $to, [string] $subject, [string] $body )
{
     $smtp = new-object System.Net.Mail.SmtpClient
     $smtp.Host = $defaultSendMailHost
     $email = new-object System.Net.Mail.MailMessage
     $email.From = $defaultSendMailFrom
     $email.To.Add( $to )
     $email.Subject = $subject
     $email.Body = $body
     $smtp.Send( $email )
}

Start it up again and WHAM… 

File \\<server>\<username>\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded. The file \\<server>\<username>\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 is not digitally signed. The script will not execute on the system. Please see “get-help about_signing” for more details.

Sign my scripts?!  How dare you!  I was too annoyed to deal with it and took the ever so appalling step of changing the PowerShell Short cut to point to a local folder on my C drive.  Please don’t stop reading as I’ve learned from my mistakes and have rectified my ways.

A few weeks later I ran across the PowerShell Community Extensions, which I highly recommend PowerShell-er install and, in fact, replaced my send-mail cmdlet above.  PSCX has an option to install it’s own profile which I chose, but after that I started receiving the Digital Signing guff. 

In the end, I did what any good PowerShell-er with a growing Profile should do.  I created a cmdlet to sign my profile.  Now I can open PS, type edit-profile (or use my ep alias), save it, and hit sign-profile (sp alias) and I’m good to go.  Here it is:

function edit-profile()
{
    notepad $profile
}

function sign-profile()
{
    dir $Profiledir\*.ps1 | foreach-object { sign-script $_.FullName }
}

function sign-script( $scriptsource )
{
    get-item $scriptsource
    Set-AuthenticodeSignature $scriptsource @(Get-ChildItem cert:\CurrentUser\My -codesigning)[0]
}

set-alias sm Send-SmtpMail
set-alias ep edit-profile
set-alias sp sign-profile

Now there is a little part I left out and that’s creating yourself a certificate, but Scott Hanselman has a very good post that will walk you through this.

Technorati Profile

Signing your Powershell Profile Scripts

Running with Set-ExecutionPolicy as AllSigned or Restricted with a roaming profile?  Here’s a cmdlet pair that will sign all the scripts in your profile directory.  Makes life easier on me as I include a number of scripts into my main profile for readability:

function sign-profile()
{
    dir $Profiledir\*.ps1 | foreach-object { sign-script $_.FullName }
}

function sign-script( $scriptsource )
{
    get-item $scriptsource
    Set-AuthenticodeSignature $scriptsource @(Get-ChildItem cert:\CurrentUser\My -codesigning)[0]
}

And if you aren’t already using Powershell, stop wasting your time with the Command Prompt and go get it.  Don’t forget the Powershell Community Extensions