<?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>Jimmy Rasmussens Blog : Powershell</title><link>http://blogs.msdn.com/jimmytr/archive/tags/Powershell/default.aspx</link><description>Tags: Powershell</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SaaS in our Danish Microsoft Innovation Centre</title><link>http://blogs.msdn.com/jimmytr/archive/2007/03/17/saas-in-our-danish-microsoft-innovation-centre.aspx</link><pubDate>Sat, 17 Mar 2007 01:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1896635</guid><dc:creator>jimmytr</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jimmytr/comments/1896635.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jimmytr/commentrss.aspx?PostID=1896635</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I recently took part in a SaaS proof-of-concept session in our Microsoft Innovation Centre. During&amp;nbsp;a 3 weeks engagement we built a semi-cool prototype addressing some of the challenges hosters and ISVs face when entering the SaaS space. My colleague &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/baladi" mce_href="http://blogs.msdn.com/baladi"&gt;&lt;FONT face=Calibri size=3&gt;Michel Baladi&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; will&amp;nbsp;be posting a series of blog entries on the subject&amp;nbsp;and I will try to stay away from boring you with stuff he already covers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Here&amp;nbsp;I will describe some of the technicalities behind&amp;nbsp;a &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/baladi/archive/2007/03/16/shp-5-the-first-two-scenarios-the-a-basic-meta-data-goo-define-map-persist.aspx" mce_href="http://blogs.msdn.com/baladi/archive/2007/03/16/shp-5-the-first-two-scenarios-the-a-basic-meta-data-goo-define-map-persist.aspx"&gt;&lt;FONT face=Calibri size=3&gt;lightweight&amp;nbsp;provisioning service&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; we build during the PoC.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;At the point when you need to provision a SaaS application - be it for the initial installation or adding a new application tenant&amp;nbsp;to the system you will end up with a number of administrative tasks that has to be executed somehow. In the SaaS PoC the so-called application manifest files and runtime parameters, described in detail in Michel’s blog, will be merged to create a provisioning document (xml) containing install tasks. The provisioning service translates the incoming document into a .NET object model abstraction of these tasks. We considered a number of options for actually executing the corresponding provisioning and ended up with a solution involving Windows Workflow. The workflow is driven by a WCF service hosted in Internet Information Server. This is the first challenge – luckily Jeremy has very recently written an &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/bb266709.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb266709.aspx"&gt;&lt;FONT face=Calibri size=3&gt;article&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; about this that explains the details of this cocktail.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;In the PoC code we have simply created a sequential workflow containing all the install tasks, but it is fairly easy to extend this to parallel activities if the provisioning involves (isolated) activities on several machines. One could also extend the install tasks with corresponding compensating activities and have the workflow calling these if something in the provisioning fails - thereby helping the administrator to rollback the changes a given faulted provisioning has made. Windows Workflow will also allow the provisioning to wait for input from another system (for example in the event of a domain name registration).&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Initially I implemented some of the install tasks (copy files, add DNS A record, create web site etc.) directly in workflow activities but got (&lt;I style="mso-bidi-font-style: normal"&gt;partly&lt;/I&gt;) convinced to have a look at PowerShell Cmdlets. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;It should be a well known fact by now that Microsoft is betting on their&amp;nbsp;latest administrative console shell (PowerShell &lt;EM&gt;&lt;SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;aka&lt;/SPAN&gt;&lt;/EM&gt; Monad - and no, not the lesser known PowerShell for the X11 Windows System).&amp;nbsp;At first I was (and partly am) very skeptic about the fact that you can do so much damage so easily, but I am starting to accepts this … and I guess balancing admin power and responsibility goes for many things in our industry. I must admit after playing a bit with PowerShell that it is a major leap forward from .cmd and .bat files I’ve written in the past.&amp;nbsp;With PowerShell&amp;nbsp;I can do many of the things I would normally build small utility programs for directly in a (.ps1) script file which&amp;nbsp;&lt;U&gt;is&lt;/U&gt;&amp;nbsp;very nice. That said I would still prefer a dedicated program for a given administrative task with built-in logic for handling my misunderstanding of infrastructure “business rules”. Cmdlets does this… they are actually just mini-programs written in your managed language of choice. I can’t help myself at this point to remind you of all the very cool features our new C++/CLI language can do for you in this space – you will have &lt;I style="mso-bidi-font-style: normal"&gt;direct&lt;/I&gt; access from your C++/CLI code to all the unmanaged Windows APIs still existing in our operating systems that you would have to P/Invoke from a language such as C# or VB.NET.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Long story short - we chose to use PowerShell Cmdlets&amp;nbsp;to encapsulate common provisioning tasks such as: Creating IIS Web sites, Adding DNS Zones and Records, Altering config files etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;My colleague &lt;A class="" href="http://blogs.msdn.com/mariobriana" mce_href="http://blogs.msdn.com/mariobriana"&gt;Mario Briana&lt;/A&gt; did a lot of the legwork here and built a number of provisioning Cmdlets. We extended all install tasks with the method: &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;string&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; ToPowerShellCommand();&lt;/SPAN&gt;&lt;/P&gt;&lt;FONT face=Calibri size=3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;For example:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; ToPowerShellCommand()&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;StringBuilder&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; sb = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StringBuilder&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;sb.Append(&lt;SPAN style="COLOR: #a31515"&gt;"Add-XmlSection "&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;sb.AppendFormat(&lt;SPAN style="COLOR: #a31515"&gt;"-Filename \"\\\\{0}\\{1}\" "&lt;/SPAN&gt;, server, filename);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;sb.AppendFormat(&lt;SPAN style="COLOR: #a31515"&gt;"-XpathQuery \"{0}\" "&lt;/SPAN&gt;, xpathQuery);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;sb.AppendFormat(&lt;SPAN style="COLOR: #a31515"&gt;"-Section {0} "&lt;/SPAN&gt;, _val);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;sb.Append(&lt;SPAN style="COLOR: #2b91af"&gt;Environment&lt;/SPAN&gt;.NewLine);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; sb.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;/SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; mso-ansi-language: EN-US; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;With Add-XmlSection being one of our homegrown PowerShell Cmdlets.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; mso-ansi-language: EN-US; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;In this way all tasks extracted from a provisioning document can easily be transformed into a PowerShell command script:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;List&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;InstallTask&lt;/SPAN&gt;&amp;gt; tasks = &lt;SPAN style="COLOR: #2b91af"&gt;Parser&lt;/SPAN&gt;.ParseProvisionDocument(doc);&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;StringBuilder&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; sbScript = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;StringBuilder&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;InstallTask&lt;/SPAN&gt; t &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; tasks)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sbScript.AppendLine(t.ToPowerShellCommand());&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;(The class &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;InstallTask&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt; above is the common base class for all dedicated InstallTasks (f.ex. &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;SetXmlElementInstallTask&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;)) &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;The resulting&amp;nbsp;script from this was used initially to test our concept from the PowerShell command line. However nice the&amp;nbsp;new command line&amp;nbsp;is we needed the provisioning to be run from a&amp;nbsp;service without having an administrator executing this in a PowerShell. For this purpose&amp;nbsp;you should use a so-called runspace populated with your custom snap-ins demonstrated below:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Runspace&lt;/SPAN&gt; InitRunspace(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; provisioningSnapInName) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RunspaceConfiguration&lt;/SPAN&gt; config = &lt;SPAN style="COLOR: #2b91af"&gt;RunspaceConfiguration&lt;/SPAN&gt;.Create();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (!&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;.IsNullOrEmpty(provisioningSnapInName))&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PSSnapInException&lt;/SPAN&gt; warning;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;config.AddPSSnapIn(provisioningSnapInName, &lt;SPAN style="COLOR: blue"&gt;out&lt;/SPAN&gt; warning);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (warning != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;RunspaceFactory&lt;/SPAN&gt;.CreateRunspace(config);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Given a runspace you can create a pipeline and execute this as:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;Collection&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;PSObject&lt;/SPAN&gt;&amp;gt; output = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Collection&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;PSObject&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;Pipeline&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; pipeline = _runspace.CreatePipeline();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;using&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; (pipeline) &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp; &lt;/SPAN&gt;pipeline.Commands.AddScript(&lt;B style="mso-bidi-font-weight: normal"&gt;_script&lt;/B&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;output = pipeline.Invoke();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;With &lt;B style="mso-bidi-font-weight: normal"&gt;_script&lt;/B&gt; simply being a string representation of the PowerShell command you wish to execute – for example: “Copy-Item –Path C:\test.xml –Destination C:\test2.xml”. The creation of a runspace is a relatively expensive task (I was told – haven’t checked). In our case with the provisioning tasks being executed in a Windows Workflow it seems pretty obvious to store one common &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;Runspace&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt; in the workflow as a service: &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;WorkflowInstance&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt; instance = _runtime.CreateWorkflow(…);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 10.0pt"&gt;instance.WorkflowRuntime.AddService(runspace);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Thereby making it available in all activities in the workflow:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;ActivityExecutionStatus&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; Execute(&lt;SPAN style="COLOR: #2b91af"&gt;ActivityExecutionContext&lt;/SPAN&gt; executionContext)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: #2b91af; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;Runspace&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt; _runspace = executionContext.GetService&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Runspace&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-bidi-font-size: 15.0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The code shown above was encapsulated in a Custom Workflow Activity and the workflow built up (simply adding powershell activities to a top level sequential workflow) from the list of install tasks as discussed above. There are many more details to this but I better stop at this point and publish instead of having this document hanging around my desktop. I would like to thank the people participating in the PoC for another good experience in the Danish Microsoft Innovation Center.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1896635" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jimmytr/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://blogs.msdn.com/jimmytr/archive/tags/SaaS/default.aspx">SaaS</category></item><item><title>PowerShell Analyzer</title><link>http://blogs.msdn.com/jimmytr/archive/2006/12/07/powershell-analyzer.aspx</link><pubDate>Thu, 07 Dec 2006 00:23:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1225163</guid><dc:creator>jimmytr</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jimmytr/comments/1225163.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jimmytr/commentrss.aspx?PostID=1225163</wfw:commentRss><description>&lt;p&gt;I was recently writing a powershell script for one of my colleagues and found myself typing the script in Notepad(!). Well... today&amp;nbsp;I stumbled over an interactive environment - the so-called &lt;a href="http://www.powershellanalyzer.com/"&gt;Powershell Analyzer&lt;/a&gt;. It seems nice:&lt;/p&gt; &lt;p&gt;&lt;a href="http://powershellanalyzer.com/screenshots/PowerShellAnalyzer.png" atomicselection="true"&gt;&lt;img height="320" src="http://blogs.msdn.com/blogfiles/jimmytr/WindowsLiveWriter/PowerShellAnalyzer_13AB2/PowerShellAnalyzer%5B9%5D.png" width="460"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I am definitely going to try it out the next time someone needs a .ps1 script from me :-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1225163" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jimmytr/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/jimmytr/archive/tags/Powershell/default.aspx">Powershell</category></item></channel></rss>