<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://codebetter.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">James Kovacs</title><subtitle type="html" /><id>http://codebetter.com/blogs/james.kovacs/atom.aspx</id><link rel="alternate" type="text/html" href="http://codebetter.com/blogs/james.kovacs/default.aspx" /><link rel="self" type="application/atom+xml" href="http://codebetter.com/blogs/james.kovacs/atom.aspx" /><generator uri="http://communityserver.org" version="4.1.31106.3070">Community Server</generator><updated>2009-01-19T07:30:58Z</updated><entry><title>Top 10 Reasons to Attend DevTeach Vancouver</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/05/25/top-10-reasons-to-attend-devteach-vancouver.aspx" /><id>/blogs/james.kovacs/archive/2009/05/25/top-10-reasons-to-attend-devteach-vancouver.aspx</id><published>2009-05-26T01:17:48Z</published><updated>2009-05-26T01:17:48Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.devteach.com" target="_blank"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;margin-left:0px;border-left-width:0px;margin-right:0px;" title="DevTeach.com" border="0" alt="DevTeach.com" align="right" src="http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/james.kovacs/image_5F00_54178265.png" width="300" height="250" /&gt;&lt;/a&gt; &lt;a href="http://www.devteach.com/" target="_blank"&gt;DevTeach&lt;/a&gt; is my favourite conference of the year and it’s happening again in Vancouver on June 8-12, 2009. No, it’s not my favourite conference because I’m one of the &lt;a href="http://www.devteach.com/TechChair.aspx" target="_blank"&gt;Tech Chairs&lt;/a&gt;. It’s the other way around. I’m a Tech Chair because DevTeach is my favourite conference. For the curious, Tech Chairs do not receive an honorarium or other compensation. We do it because we love DevTeach and the community it brings together. Here are my Top 10 Reasons to attend DevTeach Vancouver.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;It’s got a dedicated &lt;a href="http://www.devteach.com/Session.aspx#122" target="_blank"&gt;Agile Track&lt;/a&gt;, baby! 18 sessions of agile goodness. &lt;/li&gt;    &lt;li&gt;The Agile Track has more TLAs than any other track, including TDD, BDD, DDD, ORM, IoC, and DSL! &lt;/li&gt;    &lt;li&gt;Internationally renowned speakers, including Oren Eini (aka Ayende Rahien), David Laribee, Michael Stiefel, Greg Young, Eric Renaud, Francois Tanguay, Claudio Lassala, Hamilton Verissimo, Owen Rogers, Donald Belcham, and me. And that’s just the Agile Track! &lt;/li&gt;    &lt;li&gt;More IoC than you can shake a stick at with sessions by Oren Eini (current maintainer of Castle Windsor), Hamilton Verissimo (creator of Castle Windsor and Microsoft PM on MEF), and me. (I feel so outclassed in that line-up.) &lt;/li&gt;    &lt;li&gt;1-day pre-conference session on &lt;a href="http://www.devteach.com/PreConference.aspx#PreAgile" target="_blank"&gt;Agile Development with IoC and ORM&lt;/a&gt; with James Kovacs and Oren Eini. &lt;a href="http://www.devteach.com/wconnect/wc.dll?FournierTransformation~1,10,4,94" target="_blank"&gt;Register now!&lt;/a&gt; ($399 CAD) Spend an intense day of coding with Oren and me learning about how to build applications with Fluent NHibernate, Windsor, AutoMapper, and other agile-friendly technologies. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://altnetconfcanada.com/" target="_blank"&gt;ALT.NET Canada&lt;/a&gt; happening June 12-14, 2009 at the same hotel. &lt;a href="http://altnetconfcanada.com/registration/index.castle" target="_blank"&gt;Register now!&lt;/a&gt; (FREE!) (DevTeach is a major sponsor of ALT.NET Canada. Thank you, JR!) &lt;/li&gt;    &lt;li&gt;.NET Rocks will be in the house again! Carl and Richard always provide lively discussion and entertainment. DevTeach Vancouver will be no different with a &lt;a href="http://www.devteach.com/BonusSession.aspx" target="_blank"&gt;.NET Rocks-hosted Visual Studio 2010 Beta 1 InstallFest&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;At DevTeach, speakers don’t hide in the Speakers Lounge. You get to meet them face-to-face and ask them questions. &lt;/li&gt;    &lt;li&gt;DevTeach Education Stimulus Package! In difficult times, DevTeach trying to help out by providing three registrations for the price of two. You can find details on the &lt;a href="http://www.devteach.com/Register.aspx" target="_blank"&gt;Registration page&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;DevTeach is a conference where speakers go to learn. Unlike other conferences, speakers actually go to each other’s sessions and participate. This results in lively discussions that are fun for speakers and attendees alike. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Hope to see you at &lt;a href="http://www.devteach.com/Register.aspx" target="_blank"&gt;DevTeach Vancouver&lt;/a&gt;! Don’t forget to register for &lt;a href="http://www.devteach.com/wconnect/wc.dll?FournierTransformation~1,10,4,94" target="_blank"&gt;the day-long Oren/James extravaganza of agile fun&lt;/a&gt;. Or &lt;a href="http://altnetconfcanada.com/registration/index.castle" target="_blank"&gt;ALT.NET Canada&lt;/a&gt;!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=237296" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /><category term="Events" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Events/default.aspx" /><category term="Courses" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Courses/default.aspx" /></entry><entry><title>Extreme ASP.NET Makeover – Getting Your House in Order</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/05/10/extreme-asp-net-makeover-getting-your-house-in-order.aspx" /><id>/blogs/james.kovacs/archive/2009/05/10/extreme-asp-net-makeover-getting-your-house-in-order.aspx</id><published>2009-05-11T05:13:33Z</published><updated>2009-05-11T05:13:33Z</updated><content type="html">&lt;p&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;margin-left:0px;border-left-width:0px;margin-right:0px;" title="Sand Zen Garden" border="0" alt="Sand Zen Garden" align="right" src="http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/james.kovacs/image_5F00_35588A9A.png" width="300" height="199" /&gt; A few months back, &lt;a href="http://www.jameskovacs.com/blog/MSDNMagazineSeriesFromWebDevToRIADev.aspx" target="_blank"&gt;I announced&lt;/a&gt; that I was doing a series of articles for MSDN Magazine on improving a “classic” ASP.NET application with modern tooling and frameworks. As an application, I chose &lt;a href="http://www.screwturn.eu" target="_blank"&gt;ScrewTurn Wiki 3.0&lt;/a&gt; to use as my example throughout. The first article, &lt;a href="http://msdn.microsoft.com/en-us/magazine/dd758790.aspx" target="_blank"&gt;Extreme ASP.NET Makeover – Getting Your House in Order&lt;/a&gt;, went live a few days ago. The article is purposefully a different format for MSDN Magazine than “traditional” articles in that it incorporates short screencasts where appropriate rather than just code snippets and pictures. (Code snippets and pictures are included too, though!) I tried to make the screencasts an integral part of the narrative where actually showing something was easier than text, pictures, or code. I would love to hear your feedback on the format and content.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Nitpickers Corner:&lt;/strong&gt; In the series, I use MSBuild as the build tool. Yes, I wrote my own PowerShell-based build tool, &lt;a href="http://code.google.com/p/psake/" target="_blank"&gt;psake&lt;/a&gt;. Yes, I use NAnt on many of my projects for clients. (They’re already using NAnt and PowerShell is a new skillset for them.) So why MSBuild for the series? Because it is installed by default with .NET 2.0 and above. Not my first choice, but a pragmatic choice for a series focused on improving what you have.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=221781" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term=".NET" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/.NET/default.aspx" /><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /><category term="Screencast" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Screencast/default.aspx" /></entry><entry><title>psake at VAN Wrap-up</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/04/09/psake-at-van-wrap-up.aspx" /><id>/blogs/james.kovacs/archive/2009/04/09/psake-at-van-wrap-up.aspx</id><published>2009-04-10T00:05:00Z</published><updated>2009-04-10T00:05:00Z</updated><content type="html">&lt;p&gt;&lt;img title="psake" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin-left:0px;margin-right:0px;border-right-width:0px;" alt="psake" src="http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/james.kovacs/psake_5F00_2982E6D7.png" align="right" border="0" height="86" width="200" /&gt; Last night I gave a presentation on psake and PowerShell to the &lt;a href="http://groups.google.com/group/virtualaltnet" target="_blank"&gt;Virtual ALT.NET (VAN) group&lt;/a&gt;. I had a fun time demonstrating how to write a psake build script, examining some psake internals, discussing the current state of the project, and generally making a fool of myself by showing how much of a PowerShell noob I really am. I believe that the presentation was recorded and will be posted online in the next few days. Then you too can see me fumbling around trying to remember PowerShell syntax. I consider myself a professional developer when it comes to many areas, but in terms of PowerShell I am a hack who learns just enough to get the job done.&lt;/p&gt;
&lt;p&gt;As promised, here are the links from the meeting&amp;hellip;&lt;/p&gt;
&lt;h3&gt;psake Resources&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://code.google.com/p/psake/" target="_blank"&gt;Project Homepage&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://groups.google.com/group/psake-users" target="_blank"&gt;Users mailing list&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://groups.google.com/group/psake-dev" target="_blank"&gt;Dev mailing list&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;PowerShell Resources&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://tinyurl.com/ceydkd" target="_blank"&gt;PowerShell Cheat Sheet&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.manning.com/payette/" target="_blank"&gt;Windows PowerShell in Action&lt;/a&gt; (book)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/powershell/" target="_blank"&gt;Windows PowerShell Team Blog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On Twitter, I have a search for #psake. If you have a question, comment, or quibble about psake, you can use the #psake hashtag or @JamesKovacs to get my attention.&lt;/p&gt;
&lt;p&gt;P.S. A number of people expressed interest in some of my dev-related PowerShell scripts, such as removing unversioned files from a SVN working copy, updating all SVN working copies off a common directory, cleaning a solution, &amp;hellip; I&amp;rsquo;ll be putting them in a publicly accessible location soon and blogging about those scripts. So please be patient and don&amp;rsquo;t adjust your sets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=192028" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="Presentations" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Presentations/default.aspx" /><category term="PowerShell" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/PowerShell/default.aspx" /></entry><entry><title>MSDN Magazine Series: From Web Dev to RIA Dev</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/03/20/msdn-magazine-series-from-web-dev-to-ria-dev.aspx" /><id>/blogs/james.kovacs/archive/2009/03/20/msdn-magazine-series-from-web-dev-to-ria-dev.aspx</id><published>2009-03-20T23:26:00Z</published><updated>2009-03-20T23:26:00Z</updated><content type="html">&lt;p&gt;I don&amp;rsquo;t have to remind everyone that we&amp;rsquo;re in the middle of a world-wide economic &lt;span style="text-decoration:line-through;"&gt;depression&lt;/span&gt; downturn. When the economy is good, it is&lt;a href="http://codebetter.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/james.kovacs/image_5F00_c6f73465_2D00_725c_2D00_4743_2D00_a182_2D00_d48b6a46f0cd.png"&gt;&lt;img style="border:0;float:right;" src="http://codebetter.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/james.kovacs/image_5F00_c6f73465_2D00_725c_2D00_4743_2D00_a182_2D00_d48b6a46f0cd.png" border="0" alt="" /&gt;&lt;/a&gt; hard enough to convince your boss to re-build an application from scratch. When the economy is bad, it is bloody near impossible. In the coming months (and potentially years), I expect that as developers we&amp;rsquo;re going to be seeing more and more &lt;a href="http://www.manning.com/baley/"&gt;brownfield projects&lt;/a&gt;, rather than greenfield ones. We&amp;rsquo;re going to see more push for evolutionary development of applications rather than wholesale replacement. We will be called upon to improve existing codebases, implement new features, and take these projects in initially unforeseen directions. We will have to learn how to be &lt;i&gt;&lt;a href="http://www.amazon.com/gp/product/0131177052?ie=UTF8&amp;amp;tag=jamkovweb-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0131177052"&gt;Working Effectively with Legacy Code&lt;/a&gt;&lt;/i&gt;. (Took some effort to coerce the title of Michael Feathers&amp;rsquo; excellent book into that last sentence.) A lot of companies have tremendous investment in existing &amp;ldquo;classic&amp;rdquo; ASP.NET websites, but there is a desire to evolve these sites rather than replace them, especially given these tough economic times. &lt;a href="http://codebetter.com/blogs/howard.dierking"&gt;Howard Dierking&lt;/a&gt;, editor of MSDN Magazine, has asked me to write a 9-week series entitled &lt;a href="http://blogs.msdn.com/msdnmagazine/archive/2009/03/18/9489211.aspx"&gt;&lt;i&gt;From Web Dev to RIA Dev&lt;/i&gt;&lt;/a&gt; where we will explore refactoring an existing &amp;ldquo;classic&amp;rdquo; ASP.NET site. We want to improve an existing ASP.NET using new technologies, such as AJAX, jQuery, and ASP.NET MVC. We want to show that you can adopt better practices, such as continuous integration, web testing (e.g. WatiN, WatiR, Selenium), integration testing, separation of concerns, layering, and more.&lt;/p&gt;
&lt;p&gt;So I have two questions for you, Dear Reader&amp;hellip;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Can you think of a representative &amp;ldquo;classic&amp;rdquo; ASP.NET website (or websites) for the project? &lt;/li&gt;
&lt;li&gt;What topics would you like to see covered? &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I should clarify what I mean&amp;hellip;&lt;/p&gt;
&lt;h5&gt;&amp;ldquo;Classic&amp;rdquo; ASP.NET Applications&lt;/h5&gt;
&lt;p&gt;I&amp;rsquo;m currently considering PetShop, IBuySpy, DasBlog, SubText, and ScrewTurn Wiki. I&amp;rsquo;m not looking for one riff with bad practices. Just an ASP.NET project in need of some TLC &amp;ndash; one that doesn&amp;rsquo;t have a decent build script, isn&amp;rsquo;t under CI, a bit shy on the testing, little to no AJAX, etc. The code should be typical of what you would see in a typical ASP.NET application. (For that reason, I am probably going to discount IBuySpy as it is built using a funky webpart-like framework, which is not typical of most ASP.NET applications.) Some of the ASP.NET applications that I just mentioned don&amp;rsquo;t exactly qualify because they do have build scripts, tests, and other features that I would like to demonstrate. I will get permission from the project owner(s) before embarking on this quest and plan to contribute any code back to the project. Needless to say that the project must have source available to be considered for this article series. So please make some suggestions!&lt;/p&gt;
&lt;h5&gt;Topics&lt;/h5&gt;
&lt;p&gt;I have a lot of ideas of technologies and techniques to explore including proper XHTML/CSS layout, jQuery, QUnit, AJAX, HTTP Modules/Handlers, build scripts, continuous integration (CI), ASP.NET MVC, web testing (probably WatiN or Selenium), refactoring to separate domain logic from codebehind/sprocs, &amp;hellip; I will cover one major topic per week over the 9-week series. So I&amp;rsquo;ve got lots of room for cool ideas. What would you like to see? What do you think is the biggest bang for your buck in terms of improving an existing ASP.NET application?&lt;/p&gt;
&lt;p&gt;Depending on the topics covered (based on your feedback here), I might use one site for the entire series or different sites to cover each topic. It would add some continuity to the series to use a single site over the 9 weeks, but after a brief inspection of the codebases mentioned above, I am having my doubts about finding a single representative site. We&amp;rsquo;ll have to see. Please leave your suggestions in the comments below. Thanks in advance!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=189539" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term=".NET" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/.NET/default.aspx" /></entry><entry><title>Confusion about PowerShell Script Signing</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/03/17/confusion-about-powershell-script-signing.aspx" /><id>/blogs/james.kovacs/archive/2009/03/17/confusion-about-powershell-script-signing.aspx</id><published>2009-03-17T18:56:06Z</published><updated>2009-03-17T18:56:06Z</updated><content type="html">&lt;p&gt;I’ve been having fun writing about my adventures in PowerShell. I would like to thank everyone for their encouragement and feedback. Something that I haven’t explicitly stated – which should go without saying as this is a blog – is that I am not a PowerShell expert. This is one man’s journey learning about PowerShell. I consider myself an expert on C#, .NET, and many other things, but as for PowerShell, I am a hacker. I learn enough to get the job done.&lt;/p&gt;  &lt;p&gt;Yes, I wrote &lt;a href="http://code.google.com/p/psake/"&gt;psake&lt;/a&gt;, which is a cool little PowerShell-based build tool, if I do say so myself. I wrote it in part to learn more about PowerShell and what was possible. (I surprised myself that I was able to write a task-based build system in a few hours with about 100 lines of PowerShell, ignoring comments.)&lt;/p&gt;  &lt;p&gt;If you’re looking for PowerShell gospel, I would recommend checking out the &lt;a href="http://blogs.msdn.com/powershell/default.aspx"&gt;Windows PowerShell Blog&lt;/a&gt; (the blog of Jeffrey Snover and the rest of the PowerShell team), &lt;a href="http://www.amazon.com/gp/product/1932394907?ie=UTF8&amp;amp;tag=jamkovweb-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1932394907"&gt;&lt;em&gt;Windows PowerShell in Action&lt;/em&gt;&lt;/a&gt; by Bruce Payette, the PowerScripting Podcast, or any of the myriad PowerShell MVP blogs. They are the experts. I’m just a hacker having fun.&lt;/p&gt;  &lt;p&gt;With that disclaimer, I hope that by documenting my PowerShell learnings in public, I will help other developers learn PowerShell. I know that I am learning great things about PowerShell from my readers. In &lt;a href="http://www.jameskovacs.com/blog/GettingStartedWithPowerShellDeveloperEdition.aspx"&gt;Getting Started with PowerShell - Developer Edition&lt;/a&gt;, I lamented the lack of grep. My friend, &lt;a href="http://www.tavaresstudios.com/"&gt;Chris Tavares&lt;/a&gt; – known for his work on Unity and ASP.NET MVC - pointed out that Select-String can perform similar functions. Awesome! Then in &lt;a href="http://www.jameskovacs.com/blog/PowerShellProcessesAndPiping.aspx"&gt;PowerShell, Processes, and Piping&lt;/a&gt;, Jeffrey Snover himself pointed out that PowerShell supports KB, MB, and GB – with TB and PB in v2 – so that you can write:&lt;/p&gt;  &lt;p&gt;get-process | where { $_.PrivateMemorySize –gt 200MB }&lt;/p&gt;  &lt;p&gt;rather than having to translate 200MB into 200*1024*1024 as I originally did. Fantastic!&lt;/p&gt;  &lt;p&gt;In &lt;a href="http://www.jameskovacs.com/blog/WritingReusableScriptsWithPowerShell.aspx"&gt;Writing Re-usable Scripts with PowerShell&lt;/a&gt;, &lt;a href="http://wekempf.spaces.live.com/"&gt;wekempf&lt;/a&gt;, &lt;a href="http://www.pseale.com/blog/"&gt;Peter&lt;/a&gt;, and &lt;a href="http://www.josheinstein.com/"&gt;Josh&lt;/a&gt; discussed the merits of setting your execution policy to Unrestricted. I corrected the post to use RemoteSigned, which means that downloaded PowerShell scripts have to be unblocked before running, but local scripts can run without requiring signing/re-signing. Thanks, guys. I agree that RemoteSigned is a better option.&lt;/p&gt;  &lt;p&gt;Let’s talk security for a second. I am careful about security. I run as a normal user on Vista and have a separate admin account. When setting up &lt;a href="http://teamcity.codebetter.com"&gt;teamcity.codebetter.com&lt;/a&gt;, the build agent runs under a least privilege account, which is why we can’t run NCover on the build server yet. (NCover currently requires admin privs, though Gnoso is working on fixing that in short order.) (Imagine if we did run builds as an Administrator or Local System. Someone could write a unit test that added a new user with admin privs to the box, log in remotely and start installing bots, malware, and other evil.) So I tend to be careful about security.&lt;/p&gt;  &lt;p&gt;Now for my real question… What is the threat model for PowerShell that requires script signing? Maybe I’m being really dense here, but I don’t get it. Let’s say I want to do something really evil like formatting your hard drive. I create a PowerShell script with “format c:” in it, exploit a security vulnerability to drop it onto your box, and exploit another security vulnerability to launch PowerShell to execute the script. (Or I name it the same as a common script, but earlier in your search path, and wait for you to execute it.) But you’ve been anal-retentive about security and only allow signed scripts. So the script won’t execute. Damn! Foiled again! But wait! Let me just rename it from foo.ps1 to foo.cmd or foo.bat and execute it from cmd.exe. If I can execute code on your computer, there are easier ways for me to do bad things than writing PowerShell scripts. Given that we can’t require signing for *.cmd and *.bat files as this would horribly break legacy compatibility, what is the advantage of requiring PowerShell scripts to be signed by default? Dear readers, please enlighten me!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; &lt;a href="http://huddledmasses.org/"&gt;Joel “Jaykul” Bennett&lt;/a&gt; provided a good explanation in the comments. I would recommend reading:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/powershell/archive/2008/09/30/powershell-s-security-guiding-principles.aspx" href="http://blogs.msdn.com/powershell/archive/2008/09/30/powershell-s-security-guiding-principles.aspx"&gt;http://blogs.msdn.com/powershell/archive/2008/09/30/powershell-s-security-guiding-principles.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;as it exlains the PowerShell Team’s design decision. The intention wasn’t to force everyone to sign scripts, but to disable script execution for most users (as they won’t use PowerShell), but allow PowerShell users to opt into RemoteSigned or Unrestricted as they so choose. Script signing is meant for administrators to set group policy and use signed scripts for administration (as one example use case of script signing).&lt;/p&gt;  &lt;p&gt;Thanks again, Joel! That was faster than sifting through the myriad posts on script signing trying to find the reasoning behind it. Once again, the advantages of learning as a community!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=189416" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="PowerShell" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/PowerShell/default.aspx" /></entry><entry><title>Writing Re-usable Scripts with PowerShell</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/03/15/writing-re-usable-scripts-with-powershell.aspx" /><id>/blogs/james.kovacs/archive/2009/03/15/writing-re-usable-scripts-with-powershell.aspx</id><published>2009-03-16T03:35:28Z</published><updated>2009-03-16T03:35:28Z</updated><content type="html">&lt;p&gt;Continuing on from &lt;a href="http://www.jameskovacs.com/blog/PowerShellProcessesAndPiping.aspx"&gt;last time&lt;/a&gt;, I will now talk about writing re-usable scripts in PowerShell. Any command that we have executed at PowerShell command line can be dropped into a script file. I have lots of little PowerShell scripts for common tasks sitting in c:\Utilities\Scripts, which I include in my path. Let’s say that I want to stop all running copies of Cassini (aka the Visual Studio Web Development Server aka WebDev.WebServer.exe).&lt;/p&gt;  &lt;p&gt;Stop-Process -name WebDev.WebServer.exe -ErrorAction SilentlyContinue&lt;/p&gt;  &lt;p&gt;This will terminate all running copies of the above-named process. ErrorAction is a common parameter for all PowerShell commands that tells PowerShell to ignore failures. (By default, Stop-Process would fail if no processes with that name were found.)&lt;/p&gt;  &lt;p&gt;We’ve got our command. Now we want to turn it into a script so that we don’t have to type it every time. Simply create a new text file with the above command text called “Stop-Cassini.ps1” on your desktop using the text editor of your choice. (The script can be in any directory, but we’ll put it on our desktop to start.) Let’s execute the script by typing the following at the PowerShell prompt:&lt;/p&gt;  &lt;p&gt;Stop-Cassini&lt;/p&gt;  &lt;p&gt;&lt;img title="Current dirctory not in search path by default" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="153" alt="Current dirctory not in search path by default" src="http://codebetter.com/blogs/james.kovacs/image_49FA89B9.png" width="1029" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;What just happened? Why can’t PowerShell find my script? By default, PowerShell doesn’t include the current directory in its search path, unlike cmd.exe. To run a script from the current directory, type the following:&lt;/p&gt;  &lt;p&gt;.\Stop-Cassini&lt;/p&gt;  &lt;p&gt;Another option is to add the current directory to the search path by modifying Computer… Properties… Advanced… Environment Variables… Path. Or you can modify it for the current PowerShell session using:&lt;/p&gt;  &lt;p&gt;$env:Path += &amp;#39;.\;&amp;#39;&lt;/p&gt;  &lt;p&gt;($env: provides access to environment variables in PowerShell. Try $env:ComputerName, $env:OS, $env:NUMBER_OF_PROCESSORS, etc.)&lt;/p&gt;  &lt;p&gt;You could also modify your PowerShell startup script, but we’ll talk about that in a future instalment. Let’s run our script again:&lt;/p&gt;  &lt;p&gt;&lt;img title="ExecutionPolicy error" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="152" alt="ExecutionPolicy error" src="http://codebetter.com/blogs/james.kovacs/image_4196B462.png" width="1029" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;No dice again. By default, PowerShell does not allow unsigned scripts to run. This is a good policy on servers, but is a royal pain on your own machine. That means that every time you create or edit a script, you have to sign it. This doesn’t promote the use of quick scripts for simplifying development and administration tasks. So I turn off the requirement for script signing by running the following command from an elevated (aka Administrator) PowerShell prompt:&lt;/p&gt;  &lt;p&gt;&lt;strike&gt;Set-ExecutionPolicy Unrestricted&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;Set-ExecutionPolicy RemoteSigned&lt;/p&gt;  &lt;p&gt;&lt;img title="Set-ExecutionPolicy succeeded" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="91" alt="Set-ExecutionPolicy succeeded" src="http://codebetter.com/blogs/james.kovacs/image_20370EC6.png" width="1029" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;If this command fails with an access denied error:&lt;/p&gt;  &lt;p&gt;&lt;img title="Set-ExecutionPolicy failed" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="136" alt="Set-ExecutionPolicy failed" src="http://codebetter.com/blogs/james.kovacs/image_3EA14FAF.png" width="1029" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;then make sure that you launched a new PowerShell prompt via right-click Run as administrator…&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Third time is the charm…&lt;/p&gt;  &lt;p&gt;&lt;img title="Success!" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="99" alt="Success!" src="http://codebetter.com/blogs/james.kovacs/image_4B2EFCCB.png" width="1029" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;We are now able to write and use re-usable scripts in PowerShell. In my next instalment, we’ll start pulling apart some more complicated scripts that simplify common developer tasks.&lt;/p&gt;  &lt;p&gt;UPDATE: As pointed out by Josh in the comments, setting your execution policy to RemoteSigned (rather than Unrestricted) is a better idea. Downloaded scripts will require you to unblock them (Right-click… Properties… Unblock or &lt;a href="http://www.jameskovacs.com/blog/ZoneStripper10Released.aspx"&gt;ZoneStripper&lt;/a&gt; if you have a lot) before execution. Thanks for the correction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=189329" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="PowerShell" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/PowerShell/default.aspx" /></entry><entry><title>Coffee and Code Coming to Calgary</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/03/09/coffee-and-code-coming-to-calgary.aspx" /><id>/blogs/james.kovacs/archive/2009/03/09/coffee-and-code-coming-to-calgary.aspx</id><published>2009-03-09T19:42:31Z</published><updated>2009-03-09T19:42:31Z</updated><content type="html">&lt;p&gt;&lt;img title="Coffee and Code" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin-left:0px;margin-right:0px;border-right-width:0px;" height="238" alt="Coffee and Code" src="http://codebetter.com/blogs/james.kovacs/image_624A10B1.png" width="380" align="right" border="0" /&gt; &lt;a href="http://www.joeydevilla.com/"&gt;Joey Devilla&lt;/a&gt; (aka The Accordian Guy) from Microsoft’s Toronto office started &lt;em&gt;&lt;a href="http://www.coffeeandcode.org/"&gt;Coffee and Code&lt;/a&gt;&lt;/em&gt; a few weeks ago in Toronto and &lt;a href="http://blogs.msdn.com/cdndevs/"&gt;John Bristowe&lt;/a&gt; is bringing the experience to Calgary. When John contacted me about the event, I thought to myself, “I like coffee. I like code. I want to be involved!” (Heck, I would order an Americano via intravenous drop if I could.) So John and I will be hanging at the &lt;a href="http://www.kawacalgary.ca/kawa.php"&gt;Kawa Espresso Bar&lt;/a&gt; this Friday for the entire day drinking coffee, cutting code, and talking to anyone and everyone about software development. John is broadly familiar with a wide variety of Microsoft development technologies, as am I. I’ll also be happy to talk about Castle Windsor (DI/IoC), NHibernate (ORM), OOP and SOLID, TDD/BDD, continuous integration, software architectures, ASP.NET MVC, WPF/Prism, build automation with psake, … Curious what &lt;a href="http://altdotnet.org"&gt;ALT.NET&lt;/a&gt; is about, I’ll be happy to talk about that too! I got &lt;a href="http://www.jameskovacs.com/blog/CalgaryNETUserGroupPresentationPostponed.aspx"&gt;my cast&lt;/a&gt; off today from my ice skating accident two weeks ago and am in a half-cast now. So I am hopeful that I’ll be able to demonstrate some &lt;a href="http://www.jameskovacs.com/blog/CategoryView.aspx?category=Screencast"&gt;ReSharper Jedi skills&lt;/a&gt; for those curious about the amazing tool that is &lt;a href="http://www.jetbrains.com/resharper"&gt;ReSharper&lt;/a&gt;. (I am going to be daring and have a &lt;a href="http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+4.5+Nightly+Builds"&gt;nightly build of ReSharper 4.5&lt;/a&gt; on my laptop to show off some new features.) So come join John and I for some caffeinated coding fun at the &lt;strong&gt;Kawa Espresso Bar&lt;/strong&gt; anytime between &lt;strong&gt;9am and 4pm Friday, March 13, 2009&lt;/strong&gt;.&lt;/p&gt;   &lt;p&gt;This post has been brought to you by the letter C and the number 4…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=189103" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term=".NET" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/.NET/default.aspx" /><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /><category term="Events" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Events/default.aspx" /></entry><entry><title>Announcing TeamCity.CodeBetter.com</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/02/24/announcing-teamcity-codebetter-com.aspx" /><id>/blogs/james.kovacs/archive/2009/02/24/announcing-teamcity-codebetter-com.aspx</id><published>2009-02-24T21:37:40Z</published><updated>2009-02-24T21:37:40Z</updated><content type="html">&lt;p&gt;&lt;img title="teamcity.codebetter.com" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="533" alt="teamcity.codebetter.com" src="http://codebetter.com/blogs/james.kovacs/image_5DD82772.png" width="600" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://codebetter.com"&gt;CodeBetter&lt;/a&gt; – in collaboration with &lt;a href="http://www.jetbrains.com"&gt;JetBrains&lt;/a&gt;, &lt;a href="http://ideavine.net/"&gt;IdeaVine&lt;/a&gt;, and &lt;a href="http://devlicio.us"&gt;Devlicio.us&lt;/a&gt; – is proud to announce the launch of &lt;a href="http://teamcity.codebetter.com"&gt;TeamCity.CodeBetter.com&lt;/a&gt; – a continuous integration server farm for open source projects. JetBrains is generously supporting our community efforts by funding the monthly costs of the server farm and providing a &lt;a href="http://www.jetbrains.com/teamcity/"&gt;TeamCity&lt;/a&gt; Enterprise license. Volunteers from CodeBetter, IdeaVine, and Devlicio.us are administering the servers and setting up OSS projects on the build grid. We are currently providing CI for the following projects (in alphabetical order):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://fluentnhibernate.org/"&gt;Fluent NHibernate&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://code.google.com/p/masstransit/"&gt;MassTransit&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://nhforge.org/"&gt;NHibernate&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://ayende.com/"&gt;Rhino Tools&lt;/a&gt; (including Rhino Mocks, Rhino Commons, Rhino ServiceBus, …)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://storyteller.tigris.org/"&gt;Story Teller&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://structuremap.sourceforge.net"&gt;Structure Map&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We will be adding additional OSS projects in the coming weeks/months. You can &lt;a href="http://teamcity.codebetter.com/registerUser.html?init=1"&gt;register for an account here&lt;/a&gt; or &lt;a href="http://teamcity.codebetter.com/guestLogin.html?guest=1"&gt;log in as a guest&lt;/a&gt;. By default, new users can view all hosted projects. If you are a project member, you can email us at &lt;a href="mailto:teamcity@codebetter.com"&gt;teamcity@codebetter.com&lt;/a&gt; to have us add you as a project member. (N.B. You only need to be a project member on TeamCity if you need to manage/modify the build.)&lt;/p&gt;  &lt;p&gt;The current build grid consists of:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;TeamCity – Dual CPU Quad-Core Xeon 5310 @ 1.60 GHz (clovertown) with 4GB RAM &amp;amp; 2x250GB SATA II in RAID-1 &lt;/li&gt;    &lt;li&gt;Agents – Single CPU Dual-Core Xeon 5130 @ 2.00 GHz (Woodcrest) with 4GB RAM &amp;amp; 2x250GB SATA II&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Both are physical servers hosted by &lt;a href="http://softlayer.com/"&gt;SoftLayer&lt;/a&gt;. As we add more projects, we will add additional agent servers to distribute the load. Each agent will have the following software installed:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Microsoft Windows Server 2003 R2 Standard x64 Edition SP2&lt;/li&gt;    &lt;li&gt;Microsoft .NET Framework 1.1, 2.0 SP2, 3.0 SP2, 3.5 SP1&lt;/li&gt;    &lt;li&gt;Microsoft .NET Framework 2.0 SDK&lt;/li&gt;    &lt;li&gt;Windows SDK 6.1&lt;/li&gt;    &lt;li&gt;Microsoft SQL Server 2008 Express (64-bit)&lt;/li&gt;    &lt;li&gt;Ruby 1.8.6-26 (including rake, rails, activerecord, and rubyzip)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Build scripts can be authored in NAnt, MSBuild, Rake, or any other build runner supported by TeamCity. The build farm monitors your current version control system – at SoureForge.net, Google Code, or elsewhere – for changes and supports Subversion, CVS, and other popular source control systems. (TeamCity 4.0.2 – current version – does not support GIT. GIT support is planned for the 4.1 release, which should to be released at the end of March. We will upgrade to TeamCity 4.1 as soon as it is released.)&lt;/p&gt;  &lt;p&gt;Projects can use SQL Express for integration testing. N.B. We will not be manually setting up databases, virtual directories, or other services for projects. If you need a database created, your build script must include its creation/teardown.&lt;/p&gt;  &lt;p&gt;If your build script includes unit/integration tests, TeamCity can display the results in the UI if they are in the correct format. We can work with individual projects to ensure that this is the case. TeamCity can archive build artifacts and make them available for download if projects want to make CI builds available to the community.&lt;/p&gt;  &lt;p&gt;TeamCity has rich notification mechanisms for communicating build status of projects, including email, IDE (VS, IntelliJ, Eclipse), and Windows Tray notifiers. Alternately you can subscribe to the build server’s RSS feed for &lt;a href="http://teamcity.codebetter.com/feed.html?itemsType=builds&amp;amp;buildStatus=successful&amp;amp;buildStatus=failed"&gt;succeeded and failed builds&lt;/a&gt;, &lt;a href="http://teamcity.codebetter.com/feed.html?itemsType=builds&amp;amp;buildStatus=successful"&gt;succeeded builds only&lt;/a&gt;, or &lt;a href="http://teamcity.codebetter.com/feed.html?itemsType=builds&amp;amp;buildStatus=failed"&gt;failed builds only&lt;/a&gt;. You can make use of these tools to stay apprised of current build health as team members check in changes to source control. All notifiers can be downloaded and configured through the &lt;em&gt;&lt;a href="http://teamcity.codebetter.com/profile.html?"&gt;My Settings &amp;amp; Tools menu&lt;/a&gt;&lt;/em&gt; on the &lt;a href="http://teamcity.codebetter.com/"&gt;TeamCity server&lt;/a&gt; itself.&lt;/p&gt;  &lt;p&gt;If you would like your OSS project considered for free CI hosting, you must meet the following requirements:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Active project with a commit in the last 3 months.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.opensource.org/"&gt;OSI&lt;/a&gt;-approved OSS license with a publicly available source.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We will prioritize requests for hosting solely at our discretion, though we will try to accommodate as many requests as possible. (We do have day jobs, you know.) &lt;img alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /&gt; We reserve the right to remove projects from the build farm that are monopolizing farm resources. (i.e. If a build script pegs all CPUs at 100% for one hour at a time, it’s going to get disabled so as to be fair to other projects.)&lt;/p&gt;  &lt;p&gt;To apply to have us host CI for your OSS project:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Register a user account &lt;a href="http://teamcity.codebetter.com/registerUser.html?init=1"&gt;here&lt;/a&gt;.&lt;/li&gt;    &lt;li&gt;Email &lt;a href="mailto:teamcity@codebetter.com"&gt;teamcity@codebetter.com&lt;/a&gt; with the following information:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Your user account name, which you created above.&lt;/li&gt;      &lt;li&gt;Project name &amp;amp; URL.&lt;/li&gt;      &lt;li&gt;Link to your OSI-approved OSS license.&lt;/li&gt;      &lt;li&gt;URL and type (SVN, CVS, …) of your source control system.&lt;/li&gt;      &lt;li&gt;Build runner (NAnt, MSBuild, Rake, etc.) and default target.&lt;/li&gt;      &lt;li&gt;Any additional requirements you might have.&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;CodeBetter, JetBrains, IdeaVine, and Devlicio.us are looking forward to providing free continuous integration hosting for the open source community. Please email us at &lt;a href="mailto:teamcity@codebetter.com"&gt;teamcity@codebetter.com&lt;/a&gt; if you have any questions or comments.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=188664" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="featured" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/featured/default.aspx" /><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /></entry><entry><title>Calgary .NET User Group Presentation Postponed</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/02/22/calgary-net-user-group-presentation-postponed.aspx" /><id>/blogs/james.kovacs/archive/2009/02/22/calgary-net-user-group-presentation-postponed.aspx</id><published>2009-02-23T05:16:14Z</published><updated>2009-02-23T05:16:14Z</updated><content type="html">&lt;p&gt;&lt;img title="James in Cast" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin-left:0px;margin-right:0px;border-right-width:0px;" height="205" alt="James in Cast" src="http://codebetter.com/blogs/james.kovacs/JamesInCast_05547630.jpg" width="204" align="right" border="0" /&gt;Unfortunately I’m going to have to postpone &lt;a href="http://www.jameskovacs.com/blog/ldquoLightUpYourApplicationWithConventionOverConfigurationrdquoAtCalgaryNETUserGroup.aspx"&gt;my presentation on Tuesday&lt;/a&gt; as I broke my left wrist late this afternoon while ice skating with my older son. (I was practicing skating backwards, slipped, and landed with all my weight on the one wrist.) It’s a distal radial fracture, which means lots o’ pain meds for a few days and a cast for 6-8 weeks. &lt;img alt="smile_sad" src="http://spaces.live.com/rte/emoticons/smile_sad.gif" /&gt; You can see the effects of the percocet kicking in in the photo to the right. On a positive note, they let you pick the colour of the fibreglass cast. Glad to know that you can break your bones, but still be fashion conscious. Unfortunately they didn’t have my corporate colour green, which would have been cool.&lt;/p&gt;  &lt;p&gt;So coding is going to be excruciatingly slow for awhile. I’ll reschedule the presentation once the cast comes off.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=188596" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /><category term="Presentations" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Presentations/default.aspx" /></entry><entry><title>“Light Up Your Application with Convention-Over-Configuration” at Calgary.NET User Group</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/02/22/light-up-your-application-with-convention-over-configuration-at-calgary-net-user-group.aspx" /><id>/blogs/james.kovacs/archive/2009/02/22/light-up-your-application-with-convention-over-configuration-at-calgary-net-user-group.aspx</id><published>2009-02-22T22:50:35Z</published><updated>2009-02-22T22:50:35Z</updated><content type="html">&lt;p&gt;Coming to a .NET User Group near you*… This Tuesday only…&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;Topic:&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;Light Up Your Application with Convention-Over-Configuration&lt;/strong&gt; &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Date:&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;&lt;strike&gt;Tuesday, February 24, 2009&lt;/strike&gt; &lt;font color="#ff0000"&gt;Postponed&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Time:&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;5:00 pm - 5:15 pm&lt;/strong&gt; (registration)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&amp;#160;&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;5:30 pm – ???&lt;/strong&gt; (presentation)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Location:&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;Nexen Conference Center&lt;/strong&gt;           &lt;br /&gt;801-7th Ave. S.W., Calgary, AB. (Plus 15 level)           &lt;br /&gt;&lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;time=&amp;amp;date=&amp;amp;ttype=&amp;amp;q=801+7+Avenue+S.W.+Calgary+Alberta&amp;amp;sll=51.04507,-114.06319&amp;amp;sspn=0.299599,0.914612&amp;amp;ie=UTF8&amp;amp;om=1&amp;amp;ll=51.046628,-114.077826&amp;amp;spn=0.009362,0.028582&amp;amp;z=16&amp;amp;iwloc=addr"&gt;Map&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;p&gt;Inversion of Control (IoC) containers, such as Castle Windsor, increase the flexibility and testability of your architecture by decoupling dependencies, but as an application grows, container configuration can become onerous. We will examine how convention-over-configuration can allow us to achieve simplicity in IoC configuration while still maintaining flexibility and testability. You can have your cake and eat it too!&lt;/p&gt;  &lt;p&gt;* Assuming that you live in Calgary. &lt;img alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=188566" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /><category term="Presentations" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Presentations/default.aspx" /></entry><entry><title>Mocks vs. Stubs</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/02/09/mocks-vs-stubs.aspx" /><id>/blogs/james.kovacs/archive/2009/02/09/mocks-vs-stubs.aspx</id><published>2009-02-10T05:38:22Z</published><updated>2009-02-10T05:38:22Z</updated><content type="html">&lt;p&gt;A friend, having recently upgraded to &lt;a href="http://ayende.com/Blog/archive/2008/10/05/rhino-mocks-3.5-rtm.aspx"&gt;Rhino Mocks 3.5&lt;/a&gt;, expressed his confusion regarding when to use mocks vs. stubs. He had read Martin Fowler’s &lt;a href="http://martinfowler.com/articles/mocksArentStubs.html"&gt;Mocks Aren’t Stubs&lt;/a&gt; (recommended), but was still confused with how to actually decide whether to use a mock or a stub in practice. (For a pictorial overview, check out Jeff Atwood slightly NSFW &lt;a href="http://www.codinghorror.com/blog/archives/000765.html"&gt;photo montage of dummies, fakes, stubs, and mocks&lt;/a&gt;.) I thought I’d share my response which cleared up the confusion for my friend…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;It&amp;#39;s easy to get confused. Basically, mocks specify expectation. Stubs are just stand-in objects that return whatever you give them. For example, if you were testing that invoices over $10,000 required a digital signature… &lt;/p&gt;    &lt;div style="font-size:11pt;background:white;color:black;font-family:consolas, lucida console, monospace;"&gt;     &lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Arrange&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; signature = &lt;span style="color:#2b91af;"&gt;DigitalSignature&lt;/span&gt;.Null;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; invoice = &lt;span style="color:#2b91af;"&gt;MockRepository&lt;/span&gt;.GenerateStub&amp;lt;&lt;span style="color:#2b91af;"&gt;IInvoice&lt;/span&gt;&amp;gt;();&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;invoice.Amount = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Money&lt;/span&gt;(10001M);&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;invoice.Signature = signature;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; signatureVerifier = &lt;span style="color:#2b91af;"&gt;MockRepository&lt;/span&gt;.GenerateMock&amp;lt;&lt;span style="color:#2b91af;"&gt;ISignatureVerifier&lt;/span&gt;&amp;gt;();&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;signatureVerifier.Expect(v =&amp;gt; v.Verify(signature)).Return(&lt;span style="color:blue;"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; invoiceRepository = &lt;span style="color:#2b91af;"&gt;MockRepository&lt;/span&gt;.GenerateMock&amp;lt;&lt;span style="color:#2b91af;"&gt;IInvoiceRepository&lt;/span&gt;&amp;gt;();&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; accountsPayable = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;AccountsPayable&lt;/span&gt;(signatureVerifier, invoiceRepository);&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Act &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;accountsPayable.Receive(invoice);&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Assert &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;invoiceRepository.AssertWasNotCalled(r =&amp;gt; r.Insert(invoice));&lt;/pre&gt;

    &lt;pre style="margin:0px;"&gt;signatureVerifier.VerifyAllExpectations(); &lt;/pre&gt;
  &lt;/div&gt;

  &lt;p&gt;I don&amp;#39;t have a real invoice. It&amp;#39;s a proxy generated by Rhino Mocks using Castle DynamicProxy. You just set/get values on the properties. Generally I use the real object, but stubs can be handy if the real objects are complex to set up. (Then again, I would consider using an ObjectMother first.)&lt;/p&gt;

  &lt;p&gt;Mocks on the other hand act as probes to detect behaviour. We are detecting whether the invoice was inserted into the database without requiring an actual database. We are also expecting the SignatureVerifier to be called and specifying its return value. &lt;/p&gt;

  &lt;p&gt;Now the confusing part... You can stub out methods on mocks too. If you don&amp;#39;t care whether a method/property on a mock is called (by you do care about other aspects of the mock), you can stub out just that part. &lt;strike&gt;You cannot however call Expect or Stub on stubs.&lt;/strike&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I’m including my comments inline as they respond to important points raised by Aaron and John in the comments and many readers don’t bother looking through comments. :)&lt;/p&gt;

&lt;p&gt;@Aaron Jensen – As Aaron points out in the comments, you are really mocking or stubbing a method or property, rather than an object. The object is just a dynamically generated proxy to intercept these calls and relay them back to Rhino Mocks. Whether it’s a mock/stub/dummy/fake doesn’t matter.&lt;/p&gt;

&lt;p&gt;Like Aaron, I prefer AssertWasCalled/AssertWasNotCalled. I only use Expect/Verify if the API requires me to supply return values from a method/property as shown above.&lt;/p&gt;

&lt;p&gt;I also have to agree that Rhino Mocks, while a great mocking framework that I use everyday, is showing its age. It has at least 3 different mocking syntaxes (one of which I contributed), which increases the confusion. It’s powerful and flexible, but maybe a bit too much. Rhino Mocks vNext would likely benefit from deprecating all but the AAA syntax (the one borrowed from Moq) and doing some house-cleaning on the API. I haven’t given Moq an honest try since its initial release so I can’t comment on it.&lt;/p&gt;

&lt;p&gt;@John Chapman – Thanks for the correction. I’ve had Rhino Mocks throw an exception when calling Expect/Stub on a stub. I assumed it was expected behaviour that these methods failed for stubs, but it looks like a bug. (The failure in question was part of an overly complex test and I can’t repro the issue in a simple test right now. Switching from stub to mock did fix the issue though.) stub.Stub() is useful for read-only properties, but generally I prefer getting/setting stub.Property directly. Still stub.Expect() and stub.AssertWasCalled() seems deeply wrong to me. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=188241" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term=".NET" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/.NET/default.aspx" /><category term="Agile" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Agile/default.aspx" /></entry><entry><title>PowerShell, Processes, and Piping</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/02/07/powershell-processes-and-piping.aspx" /><id>/blogs/james.kovacs/archive/2009/02/07/powershell-processes-and-piping.aspx</id><published>2009-02-08T05:38:15Z</published><updated>2009-02-08T05:38:15Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.jameskovacs.com/blog/GettingStartedWithPowerShellDeveloperEdition.aspx"&gt;Last time&lt;/a&gt;, I discussed why you as a developer might be interested in PowerShell and gave you some commands to start playing with. I said we’d cover re-usable scripts, but I’m going to delay that until next post as I want to talk more about life in the shell…&lt;/p&gt;  &lt;p&gt;PowerShell feels a lot like cmd.exe, but with a lot more flexibility and power. If you’re an old Unix hack like me, you’ll appreciate the ability to combine (aka pipe) commands together to do more complex operations. Even more powerful than Unix command shells is the fact that rather than inputting/outputting strings as Unix shells do, PowerShell inputs and outputs objects. Let me prove it to you…&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;At a PowerShell prompt, run “get-process” to get a list of running processes. (Remember that PowerShell uses single nouns for consistency.) &lt;/li&gt;    &lt;li&gt;Use an array indexer to get the first process: “(get-process)[0]” (The parentheses tell PowerShell to run the command.) &lt;/li&gt;    &lt;li&gt;Now let’s get really crazy… “(get-process)[0].GetType().FullName” &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;As a .NET developer, you should recognize “.GetType().FullName”. You’re getting the class object (aka System.Type) for the object returned by (get-process)[0] and then asking it for its type name. What does this command return?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://codebetter.com/blogs/james.kovacs/image_4CEA3BD5.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="75" alt="image" src="http://codebetter.com/blogs/james.kovacs/image_thumb_62F0A767.png" width="466" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That’s right! The PowerShell command, get-process, returns an array of System.Diagnostics.Process objects. So anything you can do to a Process object, you can do in PowerShell. To figure out what else we can do with a Process object, you can look up your MSDN docs or just ask PowerShell itself.&lt;/p&gt;  &lt;p&gt;get-member –inputObject (get-process)[0]&lt;/p&gt;  &lt;p&gt;Out comes a long list of methods, properties, script properties, and more. Methods and properties are the ones defined on the .NET object. Script properties, alias properties, property sets, etc. are defined as object extensions by PowerShell to make common .NET objects friendlier for scripting.&lt;/p&gt;  &lt;p&gt;Let’s try something more complex and find all processes using more than 200MB of memory:&lt;/p&gt;  &lt;p&gt;get-process | where { $_.PrivateMemorySize –gt 200*1024*1024 }&lt;/p&gt;  &lt;p&gt;Wow. We’ve got a lot to talk about. The pipe (|) takes the objects output from get-process and provides them as the input for the next command, where – which is an alias for Where-Object. Where requires a scriptblock denoted by {}, which is PowerShell’s name for a lambda function (aka anonymous delegate). The where command evaluates each object with the scriptblock and passes along any objects that return true. $_ indicates the current object. So we’re just looking at Process.PrivateMemorySize for each process and seeing if it is greater than 200 MB.&lt;/p&gt;  &lt;p&gt;Now why does PowerShell use –gt, –lt, –eq, etc. for comparison rather than &amp;gt;, &amp;lt;, ==, etc.? The reason is that for decades shells have been using &amp;gt; and &amp;lt; for input/output redirection. Let’s write to the console:&lt;/p&gt;  &lt;p&gt;‘Hello, world!’&lt;/p&gt;  &lt;p&gt;Rather than writing to the console, we can redirect the output to a file like this:&lt;/p&gt;  &lt;p&gt;‘Hello, world!’ &amp;gt; Hello.txt&lt;/p&gt;  &lt;p&gt;You’ll notice that a file is created called Hello.txt. We can read the contents using Get-Content (or its alias, type).&lt;/p&gt;  &lt;p&gt;get-content Hello.txt&lt;/p&gt;  &lt;p&gt;&lt;a href="http://codebetter.com/blogs/james.kovacs/image_0C183FA6.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="109" alt="image" src="http://codebetter.com/blogs/james.kovacs/image_thumb_2A164D9A.png" width="429" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Since &amp;gt; and &amp;lt; already have a well-established use in the shell world, the PowerShell team had to come up with another syntax for comparison operators. They turned to Unix once again and the test command. The same operators that have been used by the Unix test command for 30 years are the same ones as used by PowerShell.*&lt;/p&gt;  &lt;p&gt;So helpful tidbits about piping and redirection…&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Use pipe (|) to pass objects returned by one command as input to the next command.      &lt;ul&gt;       &lt;li&gt;ls | where { $_.Name.StartsWith(‘S’) } &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Use output redirection (&amp;gt;) to redirect the console (aka stdout) to a file. (N.B. This overwrites the destination file. You can use &amp;gt;&amp;gt; to append to the destination file instead.)      &lt;ul&gt;       &lt;li&gt;ps &amp;gt; Processes.txt &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Do not use input redirection (&amp;lt;) as it is not implemented in PowerShell v1. &lt;img alt="smile_sad" src="http://spaces.live.com/rte/emoticons/smile_sad.gif" /&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So there you have it. We can now manipulate objects returned by PowerShell commands just like any old .NET object, hook commands together with pipes, and redirect output to files. Happy scripting!&lt;/p&gt;  &lt;p&gt;* From &lt;a href="http://www.amazon.com/gp/product/1932394907?ie=UTF8&amp;amp;tag=jamkovweb-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1932394907"&gt;&lt;em&gt;Windows PowerShell in Action&lt;/em&gt;&lt;/a&gt; by Bruce Payette p101. This is a great book for anyone experimenting with PowerShell. It has lots of useful examples and tricks of the PowerShell trade. Highly recommended.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=188190" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="PowerShell" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/PowerShell/default.aspx" /></entry><entry><title>Getting Started with PowerShell - Developer Edition</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/02/01/getting-started-with-powershell-developer-edition.aspx" /><id>/blogs/james.kovacs/archive/2009/02/01/getting-started-with-powershell-developer-edition.aspx</id><published>2009-02-01T22:21:22Z</published><updated>2009-02-01T22:21:22Z</updated><content type="html">&lt;p&gt;&lt;a href="http://codebetter.com/blogs/james.kovacs/image_177140A2.png"&gt;&lt;img title="PowerShell Unix-style" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin-left:0px;margin-right:0px;border-right-width:0px;" height="255" alt="PowerShell Unix-style" src="http://codebetter.com/blogs/james.kovacs/image_thumb_14E80EE4.png" width="400" align="right" border="0" /&gt;&lt;/a&gt; Recently I was on the &lt;a href="http://powerscripting.wordpress.com"&gt;PowerScripting Podcast&lt;/a&gt; hosted by Hal Rottenberg and Jonathan Walz. I had a great time talking about &lt;a href="http://www.microsoft.com/technet/scriptcenter/topics/msh/download.mspx"&gt;PowerShell&lt;/a&gt; from a developer’s perspective and &lt;a href="http://www.jameskovacs.com/blog/IntroducingPsake.aspx"&gt;psake&lt;/a&gt;, my PowerShell-based build system, in particular. You can find the interview on &lt;a href="http://powerscripting.wordpress.com/2009/01/25/episode-56-james-kovacs-talks-about-psake/"&gt;Episode 56 here&lt;/a&gt;. Thanks to Hal and Jonathan for having me on the show.&lt;/p&gt;  &lt;p&gt;Now let’s talk PowerShell and scripting for developers. I don’t see a lot of developers using the command line and this surprises me. Maybe it’s my Unix background that attracts me to the command line. Maybe it’s my belief that sustainable, maintainable development is facilitated by a CI process, which necessitates being familiar with the command line. Maybe it’s because the only way to create reproducible results is to automate and the easiest way to automate is the command line. Whatever the reason, I believe that developers should become familiar with copying, building, deploying, and otherwise automating tasks via the command line.&lt;/p&gt;  &lt;p&gt;So why PowerShell? PowerShell is a full-fledged programming language focused on object-based shell scripting. Note that I didn’t say “object-oriented”. You cannot create class hierarchies or define polymorphic relationships, but you can instantiate and use objects defined in other .NET-based programming languages (or COM objects). PowerShell is a shell language, meaning that it serves the same role as cmd.exe, bash, tcsh, etc. It’s raison d’etre is automating the command prompt. Manipulating directories/files, launching applications, and managing processes is really straightforward.&lt;/p&gt;  &lt;p&gt;Microsoft is investing heavily in PowerShell and providing support for managing Windows Server 2008, IIS7, SQL Server 2008, Exchange 2007, and other Microsoft server products. This means that we are approaching the Nirvana that is end-to-end build to deploy. Imagine getting latest from your source repository, building the code, unit/integration testing the code, building the documentation, labelling the build, and deploying into a QA environment! The entire process is automated and reproducible. You know the exact version of the code that went into QA. When you get the green light to do a live deployment, you give the same PowerShell scripts to the IT deployment team who uses it to deploy the compiled (and QA’d) bits into the production environment! Who best to write these deployment scripts than your friendly neighbourhood IT Pro, who is intimately familiar with the production and QA environments. This is a great collaboration point to get the IT Pros, who will be deploying and maintaining your apps, involved in the development process.&lt;/p&gt;  &lt;p&gt;Enough chitchat. Show me the code! Believe it or not, you probably already know a fair amount of PowerShell. Many of the commands you’re familiar with in cmd.exe work in PowerShell. (More surprisingly, many of the common commands you know from bash, tcsh, or other Unix shells also work!) The command line arguments are often different, but the basic familiar commands are there. So try out dir, cd, copy, del, move, pushd, popd, … (If you’re a old Unix hacker, you can try out ls, man, kill, pwd, ps, lp, cp, … Unfortunately there is no grep equivalent built in, which is terribly unfortunate.) All of these commands are actually aliases to PowerShell commands, which are named by VERB-NOUN, where NOUN is singular. For example to get a list of running processes, you run Get-Process, which is aliased to “ps”.&lt;/p&gt;  &lt;p&gt;PowerShell is very conducive to experimentation. You can always find out more about a command or alias typing “Get-Help [CmdName|Alias]” or simply “help [CmdName|Alias]” since help is an alias for Get-Help. (N.B. PowerShell is case insensitive.) You can also look for commands by typing part of the command and pressing tab repeatedly. For example, if you want to find all set- commands, type “set-[TAB][TAB]…” to display Set-Acl, Set-Alias, etc. You can also look for commands using wildcards. Type “*-Acl[TAB][TAB]…” displays Get-Acl and Set-Acl.&lt;/p&gt;  &lt;p&gt;So start playing around with PowerShell. Learn what it can do for you. Next time, we’ll look at writing re-usable scripts for accomplishing common developer tasks. Until then, happy scripting!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=187956" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="PowerShell" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/PowerShell/default.aspx" /></entry><entry><title>Installing ReSharper 4.5 in an Experimental Visual Studio Hive</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/01/20/installing-resharper-4-5-in-an-experimental-visual-studio-hive.aspx" /><id>/blogs/james.kovacs/archive/2009/01/20/installing-resharper-4-5-in-an-experimental-visual-studio-hive.aspx</id><published>2009-01-21T06:25:36Z</published><updated>2009-01-21T06:25:36Z</updated><content type="html">&lt;p&gt;Visual Studio 2008 SP1 and ReSharper 4.1 were happily running and helping me develop software, but I wanted to try out the early drops of ReSharper 4.5, which you can find &lt;a href="http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+4.5+Nightly+Builds"&gt;here&lt;/a&gt;. I didn’t want to disturb my existing install. So I went looking for a way to run ReSharper 4.1 and 4.5 side-by-side. JetBrains provides the following installation notes, which gave a glimmer of hope.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.jetbrains.net/confluence/display/ReSharper/Installation+Notes+for+ReSharper"&gt;http://www.jetbrains.net/confluence/display/ReSharper/Installation+Notes+for+ReSharper&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Let me start off by saying that I don’t have any meaningful experience building add-ins for Visual Studio. Everything below was gleaned from JetBrains and MSDN documents. Having gone through the trouble, I wouldn’t recommend this approach due to certain – apparently inherent - limitations. (The biggest limitation is that you can only run Visual Studio from the experimental hive as an administrator. The RANU switches might give you a glimmer of hope, but JetBrains would have to update its install utility to support it, as far as I can tell.)&lt;/p&gt;  &lt;p&gt;Honestly, turn back now! It’s not worth the trouble. If you’re really concerned about the cleanliness of your Visual Studio install, I would recommend installing VS2008 and ReSharper 4.5 in a virtual machine. If not, then I would recommend uninstalling ReSharper 4.1, installing ReSharper 4.5, and tolerating any glitches in the early builds. The occasional glitch is probably going to be less annoying than the instructions below! &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; ReSharper 4.5 builds are daily builds of a product that is in active development. JetBrains is very upfront about the quality of builds on their daily builds page. Whichever method you choose – experimental hive or regular install – be prepared to upgrade to a later build on at least a weekly or biweekly basis.&lt;/p&gt;  &lt;p&gt;Oh, you’re still here. I guess you really want to know about how to install ReSharper into an experimental Visual Studio hive. Don’t say I didn’t warn you.&lt;/p&gt;  &lt;p&gt;Let’s take a journey into the black art of Visual Studio add-in development… If you’re developing an add-in for Visual Studio, how the heck do you develop and debug it safely. How do you develop in one copy of Visual Studio and use it to debug another copy of Visual Studio running your plug-in? You use experimental Visual Studio hives. Visual Studio hives are areas of the Windows registry that Visual Studio uses to store configuration information. Visual Studio uses the key HKLM\SOFTWARE\[Wow6432Node]\Microsoft\VisualStudio\9.0 to store its default hive. (If you’re running 64-bit Windows, configuration information is stored beneath the Wow6432Node because Visual Studio 2008 is a 32-bit program. If you’re running 32-bit Windows, the registry path doesn’t contain the Wow6432Node.) If you install into an experimental hive, a suffix is appended to the registry path. For example, we’ll be using an experimental hive called ReSharper. So the registry path is HKLM\SOFTWARE\[Wow6432Node]\Microsoft\VisualStudio\9.0ReSharper. When you launch Visual Studio, you can direct it to the default hive (launch VS normally) or an experimental hive via:&lt;/p&gt;  &lt;p&gt;devenv /RootSuffix ReSharper&lt;/p&gt;  &lt;p&gt;You can have as many experimental hives as you like. This leaves you free to try out different add-ins, ReSharper or otherwise, in a relatively isolated fashion. The choice of “ReSharper” as my experimental hive name is completely arbitrary. I could just as easily called it Ickyickyickyickypatangzoopboing. (Bonus points if you can place the experimental hive name.) :)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Please note &lt;/strong&gt;that you’ll be mucking around with your registry and in particular, your Visual Studio install. If things go really badly, you could have to re-install Visual Studio or even your OS. Probably not, but this is an unsupported install mode. Use the same care as directly editing your Windows Registry (which is essentially what you’re doing). I’m not responsible for any damage you may cause. No warranty express or implied. Do not wash in hot. Objects in mirror may be closer than they appear… &lt;img alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /&gt;&lt;/p&gt;  &lt;p&gt;You’ll need to download the Visual Studio 2008 SDK 1.1 – the version of the SDK for Visual Studio 2008 SP1. (It would have been too easy to call it the Visual Studio 2008 SP1 SDK.) You can find it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=59ec6ec3-4273-48a3-ba25-dc925a45584d&amp;amp;DisplayLang=en"&gt;here&lt;/a&gt;. The SDK contains tools for managing experimental Visual Studio hives. The one that we’ll need is called &lt;a href="http://msdn.microsoft.com/en-us/library/cc138541.aspx"&gt;VsRegEx&lt;/a&gt;, which is a command line tool for creating, modifying, and deleting experimental Visual Studio hives. We’ll be creating an experimental hive called ReSharper by copying our default hive.&lt;/p&gt;  &lt;p&gt;Open a Visual Studio 2008 Command Prompt as an administrator. (Shift-right-click on Visual Studio 2008 Command Prompt, Run as… Administrator.)&lt;/p&gt;  &lt;p&gt;&lt;code&gt;cd C:\Program Files (x86)\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Tools\Bin      &lt;br /&gt;VsRegEx GetOrig 9.0 ReSharper&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;Be patient. This might take a minute or two. (If you want to delete the experimental hive later, run “VsRegEx Delete 9.0 ReSharper”. Note the space between 9.0 and ReSharper.)&lt;/p&gt;  &lt;p&gt;Download and install your preferred daily build of ReSharper 4.5. &lt;strong&gt;IMPORTANT:&lt;/strong&gt; When installing, make sure you disable all Visual Studio integration. We’ll be performing the integration manually in the next step.&lt;/p&gt;  &lt;p&gt;Copying &lt;a href="http://www.jetbrains.net/confluence/download/attachments/11798125/InstallExperimentalHive.Proj?version=1"&gt;InstallExperimentalHive.Proj&lt;/a&gt; to the Bin directory of your ReSharper install location. (Mine is at C:\Program Files (x86)\JetBrains\ReSharper\v4.5\Bin).&lt;/p&gt;  &lt;p&gt;&lt;code&gt;cd C:\Program Files (x86)\JetBrains\ReSharper\v4.5\Bin      &lt;br /&gt;msbuild InstallExperimentalHive.Proj /t:Rebuild       &lt;br /&gt;devenv /RootSuffix ReSharper /Setup&lt;/code&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Be patient. The last step might take a few minutes.&lt;/p&gt;  &lt;p&gt;Create a shortcut to &amp;quot;devenv /RootSuffix ReSharper&amp;quot; on your desktop and mark the shortcut to run as an administrator. (Right-click the shortcut… Properties… Shortcut tab… Advanced… Run as administrator.) Double-click the shortcut and you should see:&lt;/p&gt;  &lt;p&gt;&lt;img title="ReSharper 4.5 in Experimental Hive" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="477" alt="ReSharper 4.5 in Experimental Hive" src="http://codebetter.com/blogs/james.kovacs/WindowClipping4_3FB5BD92.png" width="561" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;So there you have it. ReSharper 4.5 running in an experimental Visual Studio hive. If you install a new daily build of ReSharper 4.5, you won’t have to recreate the hive, but you may have to msbuild and devenv /Setup steps above. Have fun with trying out ReSharper 4.5!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=187611" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="Tools" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Tools/default.aspx" /></entry><entry><title>Visual Studio 2010 == Visual Studio 2008 + ReSharper</title><link rel="alternate" type="text/html" href="/blogs/james.kovacs/archive/2009/01/19/visual-studio-2010-visual-studio-2008-resharper.aspx" /><id>/blogs/james.kovacs/archive/2009/01/19/visual-studio-2010-visual-studio-2008-resharper.aspx</id><published>2009-01-19T14:30:58Z</published><updated>2009-01-19T14:30:58Z</updated><content type="html">&lt;p&gt;Do you want the next gen of next-gen applications? Get the Visual Studio 2010 CTP! Which is – according to Microsoft itself – really just Visual Studio 2008 with ReSharper installed.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://codebetter.com/blogs/james.kovacs/image_32A9BCD5.png"&gt;&lt;img title="Visual Studio 2010 == Visual Studio 2008 + ReSharper" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="480" alt="Visual Studio 2010 == Visual Studio 2008 + ReSharper" src="http://codebetter.com/blogs/james.kovacs/image_thumb_501B4C3A.png" width="618" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Take a close look. (Click on the image above for the full-size image.) The window in front clearly shows Visual Studio 2008 with the ReSharper menu (between “Test” and “Window”) and right-hand ReSharper code analysis bar (yellow square and lines indicating warnings in the file). Even funnier is the window in behind, which is the ReSharper Options dialog (ALT-R-O). This is not a photoshopped image, but an actual screenshot from Microsoft.com.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.microsoft.com/Visualstudio/products/2010/default.mspx"&gt;https://www.microsoft.com/Visualstudio/products/2010/default.mspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This gave me a chuckle. I hope it brightens your morning too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=187510" width="1" height="1"&gt;</content><author><name>james.kovacs</name><uri>http://codebetter.com/members/james.kovacs/default.aspx</uri></author><category term="Humour" scheme="http://codebetter.com/blogs/james.kovacs/archive/tags/Humour/default.aspx" /></entry></feed>