Thursday, May 22, 2008

The 30-Day PowerShell Diet

Inspired by this example, I have resolved to go on a 30-day PowerShell diet. For 30 days I will not use the Windows command window. I will use PowerShell instead. It should hopefully take only a few days to get used to using PowerShell to do all the things I normally do in a command window, and then I can start learning all the cool extra things in PowerShell. If after 30 days I don't like it,then I will stop using PowerShell for good.

The first challenge to the beginner is getting hold of a copy. A quick search leads to the official Microsoft site, but unfortunately you can't download there without installing a Windows Genuine Advantage plug-in, which I avoid whenever possible. (Not that I'm a thief, but I consider WGA an intrusion of privacy.) Happily this site lets us take advantage of PowerShell downloading without any Genuine Advantage.

After the installation I had a shortcut to PowerShell on my Start menu, which I copied to my desktop and thence to my Quick Start tray. And then came the second challenge. I almost never run the plain vanilla command window; instead I run the Visual Studio command window, which pre-loads path and environment variables so I'll be ready to run devenv.exe, sn.exe, wsdl.exe, and the whole rest of the Visual Studio tools. The command window shortcut does this by running a batch file, which in VS2008 is called vcvarsall.bat. If you try passing the batch file as a startup parameter to PowerShell you'll get syntax errors which I'm too green to understand yet. Plus, if you make it work it won't help, because PowerShell will run the batch file in a separate process, so it won't affect PowerShell's own environment.

The solution is for the shortcut to run the batch file first, then launch PowerShell. And so I edited the shortcut's properties as follows:

* this is the default

Target: %comspec% /k ""D:\Programs\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86 && %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

And now I think I'm ready to live in PowerShell for the next 29 days.

Monday, May 19, 2008

WCF Security at Cleveland Day of .NET

I want to say that Cleveland Day of .NET was terrific experience for me. Between the excellent presentations and the stimulating conversations, I learned a lot and had a great time. I won't try to list all the folks I should thank, 'cause I'd leave some out, but to everyone who helped put on the event, Thank You and Well Done!

I was gratified by the turnout at my presentation, on "WCF Security", especially considering that we started at 8:30 AM! A copy of the slides and the demo code is available from the Cleveland .NET SIG site. (I've discovered I can't upload the files directly to this blog. I don't pay anything to BlogSpot, so I guess I'm not in a position to complain.) I've also sent the material to DoDN and will post a link to it on their site as soon as it's available.

I've made a bunch of enhancements to the demo code. The service host now has five different endpoints, one for each demo scenario, and the test client calls all five in succession. The demo also includes the two scenarios that I didn't have time to show in the presentation. You're welcome to post comments here or contact me directly if you have any questions or suggestions. I'm also planning to write some more blog posts about WCF Security in coming weeks.

Tuesday, May 13, 2008

Speaking at Cleveland Day of .NET

I've been added to the speakers lineup at Cleveland Day of .NET this Saturday, May 17. This is such a late-breaking development that it's not on the schedule yet, though it may be by the time you read this. My topic will be "WCF Security", not the sexiest but it might help you keep your job (certainly helped me keep mine).

And yes, it's been a while since I updated this blog! Stay tuned ...