<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>David Aiken : DinnerNow</title><link>http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx</link><description>Tags: DinnerNow</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>64bit DinnerNow, testing, Virtual Server and Hyper-V</title><link>http://blogs.msdn.com/daiken/archive/2008/02/12/64bit-dinnernow-testing-virtual-server-and-hyper-v.aspx</link><pubDate>Wed, 13 Feb 2008 09:02:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7664738</guid><dc:creator>daiken</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/daiken/comments/7664738.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=7664738</wfw:commentRss><description>&lt;p&gt;A few people have asked questions about, or have had trouble installing the latest version of DinnerNow on 64bit Vista machines. I thought I'd take some time out to explain the 64bit story and how you can get things going.&lt;/p&gt;  &lt;p&gt;First, we don't support 64bit in the installation. We do support Vista, Vista SP1 and Windows Server 2008, but only 32bit versions. &lt;/p&gt;  &lt;p&gt;Why you may ask? Isn't 64bit the future? (or the present depending upon your outlook in life?)&lt;/p&gt;  &lt;p&gt;The simple answer is testing. &lt;/p&gt;  &lt;p&gt;To get 2.5 out the door, I have to be fairly sure that it will install on a computer outside of Redmond. This means for each test pass I do, I use 3 separate VPC's, one for each OS. The starting point is a bare OS, with none of the prerequisites installed. One by one the prerequisites are installed. If the Dependency Checker fails at any point in any OS, the OS is rolled back to the start, and the test begins again. I use undo disks for this.&lt;/p&gt;  &lt;p&gt;Once the DC passes, the undo disks are merged creating a base with the installed prerequisites. &lt;/p&gt;  &lt;p&gt;The next task is the walk through document that we include with the install. You can find this in the documents folder. DN is installed fresh and the walk though is attempted. Each time I have to rebuild, we roll back the undo disks and start the walk through again. This is repeated for each OS, so that's all of that, 3 times.&lt;/p&gt;  &lt;p&gt;Even worse, if Vista and Vista SP1 pass, then server fails a which requires a code change, the tests are restarted on ALL OS's. (How do I know the fix didn't break something on another OS?). I should really automate this testing, and at some point I may well do that.&lt;/p&gt;  &lt;p&gt;So back to 64bit, to support 64bit, not only would the DC require more configuration, but I'd now have to run through 6 complete passes. This is not something I'd like to get to without some serious testing automation. &lt;/p&gt;  &lt;p&gt;The other problem with 64bit, is the hardware we have for testing, only in the last week have I found time to upgrade to Hyper-V, which gives me the ability to run a 64bit guest OS. As a side note, Hyper-V is incredible. Even the test version we have runs more guests per server than Virtual Server did. Also if you are brave enough for a core install, its even better. ooooo and having 2 CPU's allocated to your VPC is pretty darn cool too. &lt;/p&gt;  &lt;p&gt;The last part of the &amp;quot;why doesn't DinnerNow run on 64bit&amp;quot; is the size of the DN team. There is no build labs, ship teams, test teams, product planners, developers, UX teams or anything else. If there is ever more than 2 people working on DN, its because we have contracted some development out. The final push on DinnerNow 2.5 was James and myself. Other people have helped along the way, and without them we'd never ship anything, but do keep this in mind.&lt;/p&gt;  &lt;p&gt;So will DN work on 64bit. Yes it does. The main blocker is the automated install and configuration. So what you have to do is look in the scripts/install folder. Look in the runme.ps1 powershell script file. &lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;. .\library.ps1&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;cd ..\..&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;$DinnerNowRoot = (Get-Location).Path&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;cd scripts\install&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;[Environment]::SetEnvironmentVariable(&lt;span class="str"&gt;&amp;quot;DinnerNow&amp;quot;&lt;/span&gt;,$DinnerNowRoot,&lt;span class="str"&gt;&amp;quot;machine&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;$env:DinnerNow=$DinnerNowRoot&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;new-DatabaseAlias&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;invoke-SqlRestoreCommand&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;new-WFTrackingDatabase&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;Create-SQLASPMembership&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;enable-SvcExtensions&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;create-DinnerNowVdir&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;new-selfcert&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;bind-SSLCertificate&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&amp;amp; &lt;span class="str"&gt;&amp;quot;.\Build DinnerNow.bat&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;Enable-IISCopyrightHandler&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;Deploy-Gadget&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;Create-desktopicons&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;You should see the first few lines load library.ps1. This is where most of the install/configuration code lives. (yes PowerShell is used for almost everything). After that is simple calls to scripts within the library. To get going on 64bit, all you need to do is manually work through the runme.ps1 file one script at a time. Sometimes the script will just work, sometimes you will need to change some paths. Hopefully the scripts are too cryptic and you should get through them.&lt;/p&gt;

&lt;p&gt;One last tip. Don't do this on your only machine. Use a 64bit Virtual machine, or a spare. That way when you wreck something you can just role back your undo disc and start again.&lt;/p&gt;

&lt;p&gt;Good Luck.&lt;/p&gt;

&lt;p&gt;THIS POSTING IS PROVIDED &amp;quot;AS IS&amp;quot; WITH NO WARRANTIES, AND CONFERS NO RIGHTS, NOR WILL IT HELP AS PART OF A CALORIE CONTROLLED DIET&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7664738" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item><item><title>Happy Birthday DinnerNow</title><link>http://blogs.msdn.com/daiken/archive/2008/02/08/happy-birthday-dinnernow.aspx</link><pubDate>Sat, 09 Feb 2008 02:37:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7548134</guid><dc:creator>daiken</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/daiken/comments/7548134.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=7548134</wfw:commentRss><description>&lt;p&gt;It's just over 1 year since we released the first version of DinnerNow to the Web, and I'm proud to announce today we have released DinnerNow version 2.5 - which targets the .net framework 3.5 and Visual Studio 2008.&lt;/p&gt;  &lt;p&gt;If you are not familiar with DinnerNow, check out &lt;a href="http://www.dinnernow.net"&gt;www.dinnernow.net&lt;/a&gt; for more info.&lt;/p&gt;  &lt;p&gt;So what's new in this version?&lt;/p&gt;  &lt;p&gt;Well, we've replace the entire ServicePortfolio solution with a brand new one which has considerably less code than previous versions and uses some of the new framework 3.5 features such as LINQ and workflow services. The result is something that should be more understandable, and aid in your learning.&lt;/p&gt;  &lt;p&gt;We've also done away with the Console and Windows Service host. This time around ALL the WCF Services are hosted in IIS.&lt;/p&gt;  &lt;p&gt;The workflow services have been attacked with my complexity axe, removing most of the mapping code. I always felt that got in the way of understanding the workflow - too many Order objects.&lt;/p&gt;  &lt;p&gt;We've also moved things around a little, so DinnerNow works from &lt;a href="http://localhost/dinnernow"&gt;http://localhost/dinnernow&lt;/a&gt;, rather than stealing your IIS root and messing with you hosts files and proxy settings. As part of this, check out the installation steps which show how you can generate via script your own certificate root and SSL certificate (which we bind to the site to support https)&lt;/p&gt;  &lt;p&gt;You can also hit F5 in any app and it starts debugging. (Previous versions required attachment to the web application). This coupled with the Service hosting means an impromptu&amp;#160; demo is only a mouse click away.&lt;/p&gt;  &lt;p&gt;The Web site has had a few changes too. We've tweak the CSS to work in FireFox, and also implemented more features using AJAX (and not just the update panel). The Web application is always something we hate touching as we are all server guys, so expect a few funnies.&lt;/p&gt;  &lt;p&gt;The PowerShell cmdlets have also been tweaked to make it easier to demo and the installation is now almost 100% PowerShell. The dependency checker now correctly detects the OS (for a while Vista SP1 showed up as Server 2008 which caused a few problems when trying to install server roles)&lt;/p&gt;  &lt;p&gt;The final piece is the Mobile Delivery application actually uses the CF 3.5 and WCF. It still looks like I designed the GUI, and we had to proxy the call back into the workflow service to enable the conversation to flow.&lt;/p&gt;  &lt;p&gt;There are a stack of other minor things, too numerous to mention (and I'm sure to have missed something major out too - like the fact we re-factored the database ready for...).&lt;/p&gt;  &lt;p&gt;We'd Love to hear from you about the new release. Comments, Questions are always welcome.&lt;/p&gt;  &lt;p&gt;THIS POSTING IS PROVIDED &amp;quot;AS IS&amp;quot; WITH NO WARRANTIES, AND CONFERS NO RIGHTS&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7548134" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item><item><title>LINQ and WCF Syndication</title><link>http://blogs.msdn.com/daiken/archive/2008/01/28/linq-and-wcf-syndication.aspx</link><pubDate>Tue, 29 Jan 2008 10:44:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7300895</guid><dc:creator>daiken</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/daiken/comments/7300895.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=7300895</wfw:commentRss><description>&lt;p&gt;I must admit, having survived the last 22 data access technologies, I'm really liking LINQ. The fact that I can use LINQ to query just about anything, against just about any data source is pretty cool. Lists and Arrays beware. Nested Correlated sub-queries are near - I also love to hear &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=357683" target="_blank"&gt;Luca&lt;/a&gt; speak about it.&lt;/p&gt;  &lt;p&gt;Anyway, while preparing the latest DinnerNow release (coming soon), I had to rewrite the RSS feed for the restaurant. Obviously using the Syndication Support in WCF.&lt;/p&gt;  &lt;p&gt;Since the Feed is simply returning menu items, you can imagine its a simple database call to return the menu items, then a loop to create syndication feed items for each one, then spit them out. Fine, but with LINQ, you can miss most of that out. In fact when I originally wrote this, it had 1 line of code which returned the results of a LINQ query. Some people thought this might be too much so I split it into many more lines as shown below.&lt;/p&gt;  &lt;p&gt;Key in creating the Syndication items is line 15, as part of the LINQ query. The query projects directly into SyndicationItems. Note also the Links property being populated on line 27 - all pretty neat.&lt;/p&gt;  &lt;p&gt;Since the feed type (atom or rss) is simply formatting, I actually specified this as a parameter and lines 37 to 39 work out which formatter to use, based upon the URL.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; System.ServiceModel.Syndication.SyndicationFeedFormatter GetMenuItems(&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; feedType, &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; restaurantName, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; menuType)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;     var db = &lt;span class="kwrd"&gt;new&lt;/span&gt; DinnerNowDataContext();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;     Uri incomingURI = (OperationContext.Current == &lt;span class="kwrd"&gt;null&lt;/span&gt; ? &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;http://localhost/&amp;quot;&lt;/span&gt;) : &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        OperationContext.Current.IncomingMessageHeaders.To);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;     var items = from mi &lt;span class="kwrd"&gt;in&lt;/span&gt; db.MenuItems.AsEnumerable()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;where&lt;/span&gt; ((mi.Menu.Restaurant.Name == restaurantName) &amp;amp;&amp;amp; (mi.Menu.MenuType.Trim() == menuType))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        orderby mi.Name&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        select &lt;span class="kwrd"&gt;new&lt;/span&gt; SyndicationItem()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;            Title = SyndicationContent.CreatePlaintextContent(mi.Name),&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            PublishDate = DateTime.MinValue,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            LastUpdatedTime = DateTime.MinValue,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            Id = mi.MenuId.ToString(),&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            Content = &lt;span class="kwrd"&gt;new&lt;/span&gt; TextSyndicationContent(&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        String.Format(&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;            CultureInfo.CurrentCulture,&lt;span class="str"&gt;@&amp;quot;&amp;lt;p&amp;gt;{0}&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;img src='{1}/{2}' style='border: 0px;width:216px;height:174px;' /&amp;gt;&amp;lt;/p&amp;gt;&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;                        mi.Description,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                        &lt;span class="str"&gt;&amp;quot;/DinnerNow&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;                        mi.ImageLocation), TextSyndicationContentKind.Html),&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;            Links = { SyndicationLink.CreateAlternateLink(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(incomingURI.AbsoluteUri + &lt;span class="str"&gt;&amp;quot;/&amp;quot;&lt;/span&gt; + mi.Name)) }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;         };&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;     SyndicationFeed feed = &lt;span class="kwrd"&gt;new&lt;/span&gt; SyndicationFeed(&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span class="str"&gt;&amp;quot;DinnerNow - Menu Items&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        &lt;span class="str"&gt;&amp;quot;Menu Items for Restaurant&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;        incomingURI,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;        items.ToList&amp;lt;SyndicationItem&amp;gt;()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;        );&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;     &lt;span class="kwrd"&gt;return&lt;/span&gt; (feedType.ToLower(CultureInfo.CurrentCulture).Equals(&lt;span class="str"&gt;&amp;quot;atom&amp;quot;&lt;/span&gt;) ?&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;        (&lt;span class="kwrd"&gt;new&lt;/span&gt; Atom10FeedFormatter(feed)) &lt;span class="kwrd"&gt;as&lt;/span&gt; SyndicationFeedFormatter :&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; Rss20FeedFormatter(feed));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Below is the contract, so you can see how the URL is put together. Something like http://localhost/DinnerNow/service/menussearchservice.svc/rss/restaurants/NorthWind/Dinner would activate the service.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;[OperationContract]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;[WebGet(UriTemplate = &lt;span class="str"&gt;@&amp;quot;/{feedType}/restaurants/{restaurantName}/{menuType}&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;SyndicationFeedFormatter GetMenuItems(&lt;span class="kwrd"&gt;string&lt;/span&gt; feedType, &lt;span class="kwrd"&gt;string&lt;/span&gt; restaurantName, &lt;span class="kwrd"&gt;string&lt;/span&gt; menuType);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Minus the contract, there really is only 5 lines of code - albeit split into multiple lines. Whilst this in itself is not that cool, the fact my code is no longer plagued with mind-numbing foreach loops is an absolute blessing. (re-write the above using ADO.NET if you want to see what I mean)&lt;/p&gt;

&lt;p&gt;Long Live LINQ...&lt;/p&gt;

&lt;p&gt;Note: this post was never meant to be a tutorial, simply a look how cool this is...&lt;/p&gt;

&lt;p&gt;THIS POSTING IS PROVIDED &amp;quot;AS IS&amp;quot; WITH NO WARRANTIES, AND CONFERS NO RIGHTS &lt;/p&gt;

&lt;p&gt;EVEN IF YOU HAVE A NOTE FROM YOUR MUM&lt;/p&gt;

&lt;p&gt;&lt;font face="Consolas" color="#000000" size="2"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7300895" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/General/default.aspx">General</category><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category><category domain="http://blogs.msdn.com/daiken/archive/tags/WCF/default.aspx">WCF</category></item><item><title>Dinnernow at the LEAP Conference</title><link>http://blogs.msdn.com/daiken/archive/2008/01/25/dinnernow-at-the-leap-conference.aspx</link><pubDate>Fri, 25 Jan 2008 21:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7244485</guid><dc:creator>daiken</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/daiken/comments/7244485.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=7244485</wfw:commentRss><description>&lt;P&gt;Yesterday I presented twice a 3 hour session on DinnerNow.NET to &lt;A href="http://www.enthusiasm.nl/" target=_blank mce_href="http://www.enthusiasm.nl/"&gt;Lead Enterprise Architects at the LEAP Conference&lt;/A&gt;. The session walked through our DinnerNow.Net demo (see &lt;A href="http://www.dinnernow.net/" mce_href="http://www.dinnernow.net"&gt;www.dinnernow.net&lt;/A&gt;) and talked some about the architecture, history and a whopping 1 hour demo.&lt;/P&gt;
&lt;P&gt;Since the deck contains some pictures of DinnerNow and juicy bits on the next version, I've included it here.&lt;/P&gt;
&lt;P&gt;THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7244485" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/daiken/attachment/7244485.ashx" length="1284467" type="application/vnd.openxmlformats-officedocument.pres" /><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category><category domain="http://blogs.msdn.com/daiken/archive/tags/LEAP+Conference/default.aspx">LEAP Conference</category></item><item><title>Windows Powershell and Windows Mobile SDK?</title><link>http://blogs.msdn.com/daiken/archive/2007/08/29/windows-powershell-and-windows-mobile-sdk.aspx</link><pubDate>Thu, 30 Aug 2007 02:29:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4635998</guid><dc:creator>daiken</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/daiken/comments/4635998.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=4635998</wfw:commentRss><description>&lt;p&gt;Had the pleasure of demonstrating the Windows Mobile part of DinnerNow to a Windows Mobile PM. During the demo, I loaded up Visual Studio 2008, and started the emulator ready for the mobile app. It turns out you don't need to launch VS to start the emulator, in fact you can do it using the &lt;strong&gt;Microsoft.SmartDevice.Connectivity&lt;/strong&gt; namespace.  &lt;p&gt;Not being able to help myself,&amp;nbsp;I thought - aha, I can script this now with Powershell.  &lt;p&gt;[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SmartDevice.Connectivity")  &lt;p&gt;$dm = new-object Microsoft.SmartDevice.Connectivity.DatastoreManager 1033  &lt;p&gt;$plat = $dm.GetPlatforms()  &lt;p&gt;$plat  &lt;p&gt;($plat[5]).getDevices()  &lt;p&gt;$device = ($plat[5]).getDevices()[1]  &lt;p&gt;$device.Connect()&lt;/p&gt; &lt;p&gt;You'll need the Windows Mobile SDK 6 installing, but those few lines of code should get you started.  &lt;p&gt;THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4635998" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item><item><title>Test Drivin' and installin</title><link>http://blogs.msdn.com/daiken/archive/2007/08/07/test-drivin-and-installin.aspx</link><pubDate>Wed, 08 Aug 2007 03:36:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4285413</guid><dc:creator>daiken</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/daiken/comments/4285413.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=4285413</wfw:commentRss><description>&lt;p&gt;I've been on vacation - which really means I haven't done any work for the last few weeks. Now I'm back and working on a super cool project, which I will share in a few weeks.&lt;/p&gt; &lt;p&gt;The project involves writing some code which is not part of &lt;strong&gt;DinnerNow&lt;/strong&gt;! (Although we did drop an Orcas Beta 2 version this week on codeplex &lt;a title="http://www.codeplex.com/DinnerNow/Release/ProjectReleases.aspx?ReleaseId=6232" href="http://www.codeplex.com/DinnerNow/Release/ProjectReleases.aspx?ReleaseId=6232"&gt;http://www.codeplex.com/DinnerNow/Release/ProjectReleases.aspx?ReleaseId=6232&lt;/a&gt;)&lt;/p&gt; &lt;p&gt;Since we learnt a bunch of stuff building DinnerNow, I thought it would be good to adopt the best practices from the start.&lt;/p&gt; &lt;p&gt;First,&amp;nbsp; I'm adopting a TDD approach. So you would think my first piece of code was a test. WRONG! My first piece of code is the installer!&lt;/p&gt; &lt;p&gt;Installer? - there is nothing to install. Correct. But there is still an installer project, which compiles and builds and installs pretty much nothing. (It actually installs a DLL from the 1st project - the DLL contains an empty class otherwise you cannot build an installer). I've decided to use &lt;a href="http://wix.sourceforge.net/"&gt;WIX&lt;/a&gt; as the installer technology (the same as we used for DinnerNow)&lt;/p&gt; &lt;p&gt;2nd task - another Installer! That is correct, since this is another project that won't be shipping binary code (it's a sample), there needs to be a way to install the source code. Since I now have source code, the first installer, I need a way of installing that.&lt;/p&gt; &lt;p&gt;So now I have 2 installers and no code to speak of. What does that give me. Well, I am already in "ship" mode. I don't have to scramble around at the end of the project, figuring out how to install and configure things. &lt;/p&gt; &lt;p&gt;If someone wants to take a look or to test, I hit F5 and out pops an MSI.&lt;/p&gt; &lt;p&gt;Next, a unit test for a Windows PowerShell CmdLet that doesn't exist...&lt;/p&gt; &lt;p&gt;THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4285413" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/General/default.aspx">General</category><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category><category domain="http://blogs.msdn.com/daiken/archive/tags/Installer/default.aspx">Installer</category></item><item><title>Love for the VSMMD @ TechEd</title><link>http://blogs.msdn.com/daiken/archive/2007/06/07/love-for-the-vsmmd-teched.aspx</link><pubDate>Thu, 07 Jun 2007 20:38:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3145595</guid><dc:creator>daiken</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/daiken/comments/3145595.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=3145595</wfw:commentRss><description>For me, TechEd 07 is almost over - I've finished my speaking duties, now its just networking, hanging out at the TLC and attending some sessions. (and catching up with emails). Some good news appeared in my mailbox this morning, after our session DEV...(&lt;a href="http://blogs.msdn.com/daiken/archive/2007/06/07/love-for-the-vsmmd-teched.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3145595" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category><category domain="http://blogs.msdn.com/daiken/archive/tags/VSMMD/default.aspx">VSMMD</category><category domain="http://blogs.msdn.com/daiken/archive/tags/TechEd/default.aspx">TechEd</category></item><item><title>Dinnernow Video on Channel 9</title><link>http://blogs.msdn.com/daiken/archive/2007/06/06/dinnernow-video-on-channel-9.aspx</link><pubDate>Thu, 07 Jun 2007 00:54:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3126180</guid><dc:creator>daiken</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/daiken/comments/3126180.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=3126180</wfw:commentRss><description>Hot off the tracks of our DinnerNow 1.3 release to codeplex and out Orcas release. Comes a Channel 9 video with the team that made DinnerNow. So now you can watch the video, download the code AND the 8 hands on labs. BTW, you don't need DinnerNow installed...(&lt;a href="http://blogs.msdn.com/daiken/archive/2007/06/06/dinnernow-video-on-channel-9.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3126180" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item><item><title>DinnerNow.NET - Ship Happens</title><link>http://blogs.msdn.com/daiken/archive/2007/01/31/dinnernow-net-ship-happens.aspx</link><pubDate>Thu, 01 Feb 2007 09:08:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1570253</guid><dc:creator>daiken</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/daiken/comments/1570253.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=1570253</wfw:commentRss><description>&lt;p&gt;Today, at 7pm, we made the final release version of &lt;a title="DinnerNow.NET" href="http://www.dinnernow.net/"&gt;DinnerNow.NET&lt;/a&gt;. Its been a long road from &lt;a title="James Conard Blog" href="http://blogs.msdn.com/jamescon/"&gt;James Conard's&lt;/a&gt; early ideas to the finished package. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;What is DinnerNow.NET?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;DinnerNow is a fictious marketplace where customers can order food from local restaurants for delivery to their home or office. The sample is designed to demonstrate how you can develop a connected application using several new Microsoft technologies. &lt;br&gt;&lt;/p&gt; &lt;p&gt;The demo utilizes technologies including: IIS7, ASP.NET Ajax Extensions, Linq, Windows Communication Foundation, Windows Workflow Foundation, Windows Presentation Foundation, Windows Powershell, and the .NET Compact Framework.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Why is DinnerNow.NET different?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The biggest difference is not so much the multitude of technologies used, but what we ended up doing to make it just "work".&lt;/p&gt; &lt;p&gt;The first thing about big "joiny-up-demos" is that you spend most of your time trying to get the thing to work. We spent a lot of time trying to make this as easy as possible. We ship the whole pacakge in a single MSI. We provide a way to check you have all the required bits installed, and scripts to build and configure everything too. (we also give you the source for everything so you can use it in your projects)&lt;/p&gt; &lt;p&gt;The whole project was managed in a TFS server run by our IT folks. We have custom Windows PowerShell scripts (actually the whole&amp;nbsp;source control build process, deploy is invested with powershell scripts. We found it much easier to solve problems in Powershell than&amp;nbsp;anything else, including&amp;nbsp;.net framework console applications)&amp;nbsp;to build the MSI - (which only contains source code).&lt;/p&gt; &lt;p&gt;We have some extreemly talented people working on DinnerNow.NET and it has been great working with them all. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;What is exciting about DinnerNow.NET?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;We released version 1, but that is just the start. You will see when you download it, its on &lt;a href="http://www.codeplex.com/dinnernow"&gt;codeplex&lt;/a&gt;. We are going to continue to develop DinnerNow.NET and you're going to help with ideas, bug reports and talent. It may take a day or 2 for everything to come online, but start now by downloading the demo onto your Vista or Windows Server "Longhorn" machine/vpc, install using the MSI and follow the (hopefully) obvious desktop shortcuts. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1570253" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item><item><title>What have you got on Your Box?</title><link>http://blogs.msdn.com/daiken/archive/2007/01/24/what-have-you-got-on-your-box.aspx</link><pubDate>Thu, 25 Jan 2007 03:40:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1524528</guid><dc:creator>daiken</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/daiken/comments/1524528.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=1524528</wfw:commentRss><description>&lt;p&gt;Do you know what software you have installed on your box?&lt;/p&gt; &lt;p&gt;We've been working over the last few months on a completely awesome demo called &lt;a href="http://www.dinnernow.net/"&gt;DinnerNow.NET&lt;/a&gt;. The Demo showcases many newly released Microsoft technologies including Cardspace, WCF, WF and Windows PowerShell. &lt;/p&gt; &lt;p&gt;One problem we constantly faced was people trying to load the demo on their machines but not having all the pre-requisite components installed or configured to build and run the demo. (Even though we provide a readme). What was needed was a fool(ish) proof way to figure out if the machine was ready.&lt;/p&gt; &lt;p&gt;DinnerNow.NET requires, .NET Framework 3.0, Visual Studio 2005, LINQ, AJAX, AJAX Futures, MSMQ, IIS7, SQL Server 2005 Express, Windows PowerShell (with execution policy set), WCF Extensions for Visual Studio, WF Extensions for Visual Studio and parts of the Windows SDK for Vista!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Is Windows PowerShell Installed?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;First task - Is Windows PowerShell installed. We use powershell to build, configure and manage the demo and its source code (more on that later). Since Windows PowerShell on Vista is an OOB update we should be able to find it using the win32_QuickFixEngineering WMI Provider.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;get-wmiobject win32_QuickFixEngineering&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;See the irony in the above command. Anyway, if you know the KB number you are looking from you should be able to find it.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;What about the execution policy?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Since we are using powershell scripts, we need to make the user aware that the execution policy on the machine needs to be setup.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;get-itemproperty -path HKLM:\SOFTWARE\microsoft\powershell\1\shellids\Microsoft.PowerShell&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Should give us the &lt;strong&gt;ExecutionPolicy&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Software&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Off to a good start, but wait. What software is installed on your machine can be found out many different ways:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Registry&lt;/strong&gt; - If an App uses the registry, you could check there. Windows also uses the registry to store application installation information. Where depends upon how it was installed. Typically we found most people check HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall &lt;/li&gt; &lt;li&gt;&lt;strong&gt;File System&lt;/strong&gt; - we could check for the physical presence of a binary file on the computer. The question is then where do we look. What if the user did not install to the default folder? &lt;/li&gt; &lt;li&gt;&lt;strong&gt;WMI&lt;/strong&gt; - There are several WMI classes for inspecting the software on your machine; win32_Product and&amp;nbsp;win32_softwareFeature being 2 examples.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In the end we wrote code to allow us to check using either of those techniques - but we managed to do most software checks using the Uninstall registry location. I suggest you explore the Registry and WMI options.&lt;/p&gt; &lt;p&gt;Sometimes the info in that registry key is a little cryptic. I love Guids for all they give us, but they are not meant for human consumption. &lt;/p&gt; &lt;p&gt;One neat trick using PowerShell was the ability to take a snapshot of the registry key:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;$current = dir&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Install the software we wanted to test for. Run this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;$newstuff = dir&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;then see which keys changed using this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Compare-Object $current $newstuff | format-list&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Which output this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="1"&gt;InputObject : HKEY_LOCAL_MACHINE\SOFTWARE\...\Uninstall\{D6D42959-143F-456A-9941-A400FD7B25D8}&lt;br&gt;&lt;/font&gt;&lt;font size="1"&gt;SideIndicator : =&amp;gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Which tells us the exact keys that were changed! &lt;p&gt;&lt;strong&gt;OS Version&lt;/strong&gt; &lt;p&gt;By now we almost look like we know what we are doing. OS Version is WMI Query on win32_OperatingSystem. &lt;p&gt;&lt;strong&gt;Is MSMQ there?&lt;/strong&gt; &lt;p&gt;MSMQ is a service - so another WMI query: select * from win32_Service where Name='msmq' should give the correct result. &lt;p&gt;&lt;strong&gt;What about IIS7?&lt;/strong&gt; &lt;p&gt;IIS7 is a funny one. In LHS we can use the Win32_ServerComponent WMI provider (which is new to Longhorn Server) to figure out not only what features are installed but also what roles are installed on the server (sounds like the topic of another blog) In Vista its not as clear. &lt;p&gt;&lt;strong&gt;Give me the code right NOW&lt;/strong&gt; &lt;p&gt;The Dependency Checker will be shipped as part of the dinnernow source code from &lt;a href="http://www.dinnernow.net/"&gt;http://www.dinnernow.net/&lt;/a&gt; once we hit our magic release date. (shhhhhhh) &lt;p&gt;THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1524528" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item><item><title>Windows PowerShell met CAPICOM</title><link>http://blogs.msdn.com/daiken/archive/2007/01/12/windows-powershell-met-capicom.aspx</link><pubDate>Fri, 12 Jan 2007 14:03:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1454736</guid><dc:creator>daiken</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/daiken/comments/1454736.aspx</comments><wfw:commentRss>http://blogs.msdn.com/daiken/commentrss.aspx?PostID=1454736</wfw:commentRss><description>&lt;p&gt;Part of what&amp;nbsp;I do at Microsoft is build demos. The latest demo our team is working on, DinnerNow.NET, makes use of several certificates for cardspace, which need to be installed in the certificate store. Furthermore the NETWORKSERVICE account needs to have read permission to the private key. This is typically a common requirement when using certifcates for https.&lt;/p&gt; &lt;p&gt;At first we were using a bunch of scripts from the Windows SDK. The scripts were written in VBScript and although they worked, they were not as clean as the rest of the project. Something had to be done.&lt;/p&gt; &lt;p&gt;The VBScripts used CAPICOM's COM API. CAPICOM does the trick and can be redistributed. So out came, ahem, Windows PowerShell.&lt;/p&gt; &lt;p&gt;First i needed to view the certificates.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;dir certs:\localmachine\my&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This does the trick, doesn't use CAPICOM and is built-in.&lt;/p&gt; &lt;p&gt;As an experiment I created the following which does the same thing:&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;function Get-Certificate&lt;br&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;param([string]$certStore)&lt;br&gt;$store = new-object -com "CAPICOM.Store"&lt;br&gt;$store.Open(1,"$certStore",130)&lt;br&gt;$store.Certificates &lt;br&gt;$Store.Close()&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;}&lt;/font&gt;&lt;br&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Get-Certificate "my"&lt;/font&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Shows the same certificates as the previous powershell command&lt;/p&gt; &lt;p&gt;Next i needed a way to add certificates to the store. This turned out to be easy.&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;function Add-Certificate&lt;br&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;param([String]$certPath,[String]$certStore)&lt;br&gt;$store = new-object -com "CAPICOM.Store"&lt;br&gt;$store.Open(1,"$certStore",130)&lt;br&gt;$store.Load($certPath)&lt;br&gt;$store.Close()&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;}&lt;/font&gt; &lt;/p&gt; &lt;p&gt;To add a certificate to the "my" store you would enter:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Add-Certificate "path_to_cert.pfx" "my"&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Next the permissions need to be set on the private key file.&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;function set-CertificateSecurity&lt;br&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;param([String]$certName)&lt;br&gt;$keypath = $env:ProgramData + "\Microsoft\Crypto\RSA\MachineKeys\"&lt;br&gt;$store = new-object -com "CAPICOM.Store"&lt;br&gt;$store.Open(1,"my",130)&lt;br&gt;$certToSecure = $store.Certificates | where { $_.subjectname -like "*$certName*" }&lt;br&gt;$keyname = $certToSecure.PrivateKey.UniqueContainerName&lt;br&gt;if ($keyname -is [Object])&lt;br&gt;{&amp;nbsp; icacls $keypath$keyname /grant networkservice:RX }&lt;br&gt;$store.Close()&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;}&lt;/font&gt; &lt;/p&gt; &lt;p&gt;And finally a way to remove the certificates:&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;function Remove-Certificate&lt;br&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;param([String]$certName,[String]$certStore)&lt;br&gt;$store = new-object -com "CAPICOM.Store"&lt;br&gt;$store.Open(1,"$certStore",130)&lt;br&gt;$certToDelete =( $store.Certificates | where { $_.SubjectName -like "*$certName*" })&lt;br&gt;if ($certToDelete -is [Object])&lt;br&gt;{&lt;br&gt;if ($certToDelete.PrivateKey -is [Object])&lt;br&gt;{&lt;br&gt;$certToDelete.PrivateKey.Delete()&lt;br&gt;$store.Remove($certToDelete)&lt;br&gt;}&lt;br&gt;}&lt;br&gt;$Store.Close()&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;}&lt;/font&gt;&lt;br&gt;&lt;/p&gt; &lt;p&gt;The scirpt that uses these commands looks like this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Remove-Certificate "adatum" "root"&lt;br&gt;Add-Certificate "c:\dinnernow\scripts\install\certs\adatum.sst" "root"&lt;br&gt;add-certificate "c:\dinnernow\scripts\install\certs\www.fabrikam.com.pfx" "my"&lt;br&gt;set-certificatesecurity "fabrikam" "my"&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This is another great way you can use Windwos PowerShell to reduce complexity and wrap some procedure into a nice reusable cmdlet. These scripts are just enough to do the job we needed, use these as a starting point for your own.&lt;/p&gt; &lt;p&gt;THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1454736" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/daiken/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://blogs.msdn.com/daiken/archive/tags/DinnerNow/default.aspx">DinnerNow</category></item></channel></rss>