<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007">
   <channel>
      <title>msgoodies-powershell</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=2jHdwjh_3BGdkDNcyjUFzw</link>
      <pubDate>Tue, 24 Nov 2009 06:31:42 -0800</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>Messing with output from Format-Table</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/Vw-nK2CtfM4/messing-with-output-from-format-table.html</link>
         <description>&lt;p&gt;Found at &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://psobject.codeplex.com/Thread/View.aspx?ThreadId=71064&quot;&gt;question&lt;/a&gt; at psobject.codeplex.com: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;I was wondering if I could write the outout without any blank spaces between 2 fields. For example, I am using hash tables to display 2 columns from dir output. But it always comes up with a blank space between those 2 data elements. I need this to generate a fixed format output with data elements only and no spaces in between. Any help is greatly appreciated.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;$column1 = @{expression=&quot;mode&quot;;width=5;label=&quot;mode&quot;;alignment=&quot;left&quot;} &lt;br /&gt;$column2 = @{expression=&quot;name&quot;;width=10;label=&quot;name&quot;;alignment=&quot;left&quot;}&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;$dir |format-table $column1,$column2&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;$mode&amp;#160; name &lt;br /&gt;----&amp;#160; ---- &lt;br /&gt;d---- download &lt;br /&gt;d---- extract &lt;br /&gt;-a--- alias.txt &lt;br /&gt;-a--- Compute... &lt;br /&gt;-a--- execute... &lt;br /&gt;-a--- get_dn.ps1 &lt;br /&gt;-a--- hh&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;Well, it can be done. I looked into the objects the Format-Table spit out and after some poking around, I came up with this -&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;$column1 = @{expression=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;mode&quot;&lt;/span&gt;;width=5;label=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;mode&quot;&lt;/span&gt;;alignment=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;left&quot;&lt;/span&gt;}&lt;br /&gt;$column2 = @{expression=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;name&quot;&lt;/span&gt;;width=20;label=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;name&quot;&lt;/span&gt;;alignment=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;left&quot;&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#008000;&quot;&gt;# Save widths, all non-fixed length value should specify a width&lt;/span&gt;&lt;br /&gt;$widths=@{}&lt;br /&gt;dir | format-table $column1,@{l=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;|&quot;&lt;/span&gt;;e={&lt;span style=&quot;color:#006080;&quot;&gt;&quot;|&quot;&lt;/span&gt;}},$column2 | &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; {&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;if&lt;/span&gt; ($_.pstypenames[0] &lt;span style=&quot;color:#cc6633;&quot;&gt;-eq&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&quot;Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData&quot;&lt;/span&gt;) {&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;# Capture the values and convert them to one value&lt;/span&gt;&lt;br /&gt; $value=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br /&gt; $count=$_.formatentryinfo.formatPropertyFieldList.count&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt;($i &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; 0..($count-1)) {&lt;br /&gt; $value+=$_.formatentryinfo.formatPropertyFieldList.item($i).propertyvalue.ToString().padright($widths.$i)&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;# Delete all but one field&lt;/span&gt;&lt;br /&gt; $_.formatentryinfo.formatPropertyFieldList.removerange(1,$count-1)&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;# and update its value&lt;/span&gt;&lt;br /&gt; $_.formatentryinfo.formatPropertyFieldList.item(0).propertyValue=$value&lt;br /&gt; $_&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;elseif&lt;/span&gt; ($_.pstypenames[0] &lt;span style=&quot;color:#cc6633;&quot;&gt;-eq&lt;/span&gt; &lt;span style=&quot;color:#006080;&quot;&gt;&quot;Microsoft.PowerShell.Commands.Internal.Format.FormatStartData&quot;&lt;/span&gt;) {&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;# Capture the headers and convert them to one header&lt;/span&gt;&lt;br /&gt; $value=&lt;span style=&quot;color:#006080;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br /&gt; $width=0&lt;br /&gt; &lt;br /&gt; $count=$_.shapeinfo.tablecolumninfolist.count&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt;($i &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; 0..($count-1)) {&lt;br /&gt; $w=$_.shapeinfo.tablecolumninfolist.item($i).width&lt;br /&gt; $width+=$w&lt;br /&gt; $widths.$i=$w&lt;br /&gt; $value+=$_.shapeinfo.tablecolumninfolist.item($i).propertyname.ToString().padright($w)&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;# Delete all but one field&lt;/span&gt;&lt;br /&gt; $_.shapeinfo.tablecolumninfolist.removerange(1,$count-1)&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;# and update its value&lt;/span&gt;&lt;br /&gt; $_.shapeinfo.tablecolumninfolist.item(0).propertyName=$value&lt;br /&gt; $_.shapeinfo.tablecolumninfolist.item(0).width=$width&lt;br /&gt; $_&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;else&lt;/span&gt;&lt;br /&gt; {&lt;br /&gt; $_&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you like it, convert it to a function as en exercise ;)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy formatting!&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-587090540748227651?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Vw-nK2CtfM4:-bpWIvcTk5c:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Vw-nK2CtfM4:-bpWIvcTk5c:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Vw-nK2CtfM4:-bpWIvcTk5c:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Vw-nK2CtfM4:-bpWIvcTk5c:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Vw-nK2CtfM4:-bpWIvcTk5c:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/Vw-nK2CtfM4&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-587090540748227651</guid>
         <pubDate>Thu, 19 Nov 2009 13:26:00 -0800</pubDate>
      </item>
      <item>
         <title>PS Remoting to Home Server</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/S4LgCr7_bBI/ps-remoting-to-home-server.html</link>
         <description>&lt;p&gt;I wanted to PowerShell remote to my home server, but as it is – for the good reason, that it is impossible – not in the domain of my PC, I have to add it to TrustedHosts.&lt;/p&gt; &lt;p&gt;This is my story.&lt;/p&gt; &lt;p&gt;First, I enabled PS remoting on the home server with a simple&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;Enable-PSRemoting&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Next, I attempted to access the server&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;enter-pssession server -cre server&amp;#92;administrator&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;By doing so, I received a very long error message.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I tried with –authentication negotiate. This reduced the error message to 10 lines ;) It told me to configure TrustedHosts with Winrm.cmd.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I looked at Winrm.cmd, but that looked very complicated and this is at the end of the day. Luckily, the WSMAN drive popped up in my mind. I switched to my administrative account and did this&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;PS C:&amp;#92;Users&amp;#92;user&amp;gt; cd wsman:&lt;br /&gt;PS WSMan:&amp;#92;&amp;gt; dir&lt;br /&gt;&lt;br /&gt; WSManConfig:&lt;br /&gt;&lt;br /&gt;ComputerName Type&lt;br /&gt;------------ ----&lt;br /&gt;localhost Container&lt;br /&gt;&lt;br /&gt;PS WSMan:&amp;#92;&amp;gt; cd .&amp;#92;localhost&lt;br /&gt;PS WSMan:&amp;#92;localhost&amp;gt; dir&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; WSManConfig: Microsoft.WSMan.Management&amp;#92;WSMan::localhost&lt;br /&gt;&lt;br /&gt;Name Value Type&lt;br /&gt;---- ----- ----&lt;br /&gt;MaxEnvelopeSizekb 150 System.String&lt;br /&gt;MaxTimeoutms 60000 System.String&lt;br /&gt;MaxBatchItems 32000 System.String&lt;br /&gt;MaxProviderRequests 4294967295 System.String&lt;br /&gt;Client Container&lt;br /&gt;Service Container&lt;br /&gt;Shell Container&lt;br /&gt;Listener Container&lt;br /&gt;Plugin Container&lt;br /&gt;ClientCertificate Container&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS WSMan:&amp;#92;localhost&amp;gt; cd .&amp;#92;Client&lt;br /&gt;PS WSMan:&amp;#92;localhost&amp;#92;Client&amp;gt; dir&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; WSManConfig: Microsoft.WSMan.Management&amp;#92;WSMan::localhost&amp;#92;Client&lt;br /&gt;&lt;br /&gt;Name Value Type&lt;br /&gt;---- ----- ----&lt;br /&gt;NetworkDelayms 5000 System.String&lt;br /&gt;URLPrefix wsman System.String&lt;br /&gt;AllowUnencrypted false System.String&lt;br /&gt;Auth Container&lt;br /&gt;DefaultPorts Container&lt;br /&gt;TrustedHosts System.String&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS WSMan:&amp;#92;localhost&amp;#92;Client&amp;gt; Set-Item .&amp;#92;TrustedHosts server&lt;br /&gt;&lt;br /&gt;WinRM Security Configuration.&lt;br /&gt;This command modifies the TrustedHosts list &lt;span style=&quot;color:#0000ff;&quot;&gt;for&lt;/span&gt; the WinRM client. The computers &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; the TrustedHosts list might not be authenticated. The&lt;br /&gt;client might send credential information to these computers. Are you sure that you want to modify this list?&lt;br /&gt;[Y] Yes [N] No [S] Suspend [?] Help (&lt;span style=&quot;color:#0000ff;&quot;&gt;default&lt;/span&gt; is &lt;span style=&quot;color:#006080;&quot;&gt;&quot;Y&quot;&lt;/span&gt;): y&lt;br /&gt;PS WSMan:&amp;#92;localhost&amp;#92;Client&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Back to my standard user&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;194 WSMan:&amp;#92;localhost&amp;gt; enter-pssession server -cre server&amp;#92;administrator&lt;br /&gt;[server]: PS C:&amp;#92;Documents and Settings&amp;#92;Administrator&amp;#92;My Documents&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;and it worked.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy remoting&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-7960011918149302316?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=S4LgCr7_bBI:6TosDOyZP7Q:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=S4LgCr7_bBI:6TosDOyZP7Q:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=S4LgCr7_bBI:6TosDOyZP7Q:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=S4LgCr7_bBI:6TosDOyZP7Q:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=S4LgCr7_bBI:6TosDOyZP7Q:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/S4LgCr7_bBI&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-7960011918149302316</guid>
         <pubDate>Thu, 19 Nov 2009 08:25:00 -0800</pubDate>
      </item>
      <item>
         <title>PowerShell 2.0 *is* supported for Exchange 2007 SP2</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/5EVk17SDqdY/powershell-20-is-supported-for-exchange.html</link>
         <description>&lt;p&gt;In case you wondered, the greatly improved PowerShell 2.0 &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://msexchangeteam.com/comments/452361.aspx&quot;&gt;can be installed&lt;/a&gt; on servers running Exchange 2007. But you must be running Service Pack 2.&lt;/p&gt; &lt;p&gt;BTW: You cannot find PowerShell v2 on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/downloads&quot;&gt;www.microsoft.com/downloads&lt;/a&gt;. You have to go to &lt;a rel=&quot;nofollow&quot; title=&quot;http://support.microsoft.com/kb/968929&quot; target=&quot;_blank&quot; href=&quot;http://support.microsoft.com/kb/968929&quot;&gt;http://support.microsoft.com/kb/968929&lt;/a&gt;.&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-5480030230933663676?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=5EVk17SDqdY:XdxCVitNH_8:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=5EVk17SDqdY:XdxCVitNH_8:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=5EVk17SDqdY:XdxCVitNH_8:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=5EVk17SDqdY:XdxCVitNH_8:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=5EVk17SDqdY:XdxCVitNH_8:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/5EVk17SDqdY&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-5480030230933663676</guid>
         <pubDate>Mon, 16 Nov 2009 06:00:00 -0800</pubDate>
      </item>
      <item>
         <title>Picking files with the mouse using Get-DroppedFile</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/xr7LyAmlKc4/picking-files-with-mouse-using-get.html</link>
         <description>&lt;p&gt;Sometimes (often?) it is just easier picking your files with the mouse. As long as the files are in one folder that is not that hard, but if you have files scattered all around that is tougher. Also right-clicking and copy-as-path is annoying.&lt;/p&gt; &lt;p&gt;To make this easier, I have created a small drop box function. A small transparent window will be shows and when you drop files on it, those files will be send to the output pipeline where you can do the rest of your processing.&lt;/p&gt; &lt;p&gt;I made the forms part using Visual C#. Relativily trivial. And Add-Type enabled me to embed it into my script. The hard part was making it async so that files would appear ín the output pipeline as soon as they were dropped. I had to resort to good old VB5-style DoEvents (just revealed my age, I guess). If you can come up with a non-polling solution, please let me know.&lt;/p&gt; &lt;p&gt;What it can be used for -&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Testing scripts with different files&lt;/li&gt; &lt;li&gt;Move photos to a folder, converting them as they are moved&lt;/li&gt; &lt;li&gt;Renaming files&lt;/li&gt; &lt;li&gt;Compressing files&lt;/li&gt; &lt;li&gt;continue the list yourself&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;All tasks where you – the human – can make the decision about what to do with a file are relevant.&lt;/p&gt; &lt;p&gt;With PowerShell v2 being available on all platform, do I have to say, that this is a V2-only script?&lt;/p&gt; &lt;p&gt;Please, read the comments in the script for further information.&lt;/p&gt; &lt;p&gt;Get-DroppedFile.ps1&lt;/p&gt; &lt;pre style=&quot;margin:0in 10pt;font-family:lucida console;font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;&amp;lt;#&lt;br /&gt;.Synopsis&lt;br /&gt; Create a drop box window and output the files dropped to the pipeline&lt;br /&gt;.Description&lt;br /&gt; Create a drop box window. When files are dropped, they are send to the output pipeline right away.&lt;br /&gt; Stop Get-DroppedFile by closing the window.&lt;br /&gt;.Inputs&lt;br /&gt; None&lt;br /&gt;.Outputs&lt;br /&gt; File names (-asText), IO.DirectoryInfo or IO.FileInfo objects&lt;br /&gt;.Example&lt;br /&gt; Get-DroppedFile | Copy -destination e:&amp;#92; -passthru | foreach { $x.attributes=$x.Attributes.ToString()+&quot;,readonly&quot; } &lt;br /&gt; Copy dropped files to e:&amp;#92; and set the readonly bit&lt;br /&gt;#&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#800000;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[string]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# The caption of the drop box&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$Caption&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[switch]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Return file names (full path) as text&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$AsText&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[switch]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Recurse directories, I.E. the folder itself is not returned, only its children&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$Recurse&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[switch]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# (Internal switch used to detect -sta invocation)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_InternalReinvoked&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Create the script code - direct execution or SingleThreadedApartment is determined later&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$script&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$loaded&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$false&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#800000;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[system.type]&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Get_DroppedFile.Form1&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$loaded&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$true&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#800000;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# The form code. Created in Visual C# 2008 Express and slightly adopted&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$loaded&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;add-type&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-TypeDefinition&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;@'&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Drawing;&lt;br /&gt;using System.Windows.Forms;&lt;br /&gt;&lt;br /&gt;namespace Get_DroppedFile&lt;br /&gt;{&lt;br /&gt; public partial class Form1 : Form&lt;br /&gt; {&lt;br /&gt; Color defaultColor;&lt;br /&gt; public Form1()&lt;br /&gt; {&lt;br /&gt; InitializeComponent();&lt;br /&gt; defaultColor = this.BackColor;&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void avoidWarning()&lt;br /&gt;	{&lt;br /&gt;	}&lt;br /&gt; &lt;br /&gt; private void Form1_DragDrop(object sender, DragEventArgs e)&lt;br /&gt; {&lt;br /&gt; // Back to default color&lt;br /&gt; this.BackColor = defaultColor;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private void Form1_DragOver(object sender, DragEventArgs e)&lt;br /&gt; {&lt;br /&gt; // Start dragdrop&lt;br /&gt; e.Effect = DragDropEffects.Copy;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private void Form1_DragEnter(object sender, DragEventArgs e)&lt;br /&gt; {&lt;br /&gt; // visual feedback in drag&lt;br /&gt; this.BackColor = Color.FromArgb(defaultColor.ToArgb() - 0x101010);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private void Form1_DragLeave(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt; // restore color&lt;br /&gt; this.BackColor = defaultColor;&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;namespace Get_DroppedFile&lt;br /&gt;{&lt;br /&gt; partial class Form1&lt;br /&gt; {&lt;br /&gt; /// &amp;lt;summary&amp;gt;&lt;br /&gt; /// Required designer variable.&lt;br /&gt; /// &amp;lt;/summary&amp;gt;&lt;br /&gt; private System.ComponentModel.IContainer components = null;&lt;br /&gt;&lt;br /&gt; /// &amp;lt;summary&amp;gt;&lt;br /&gt; /// Clean up any resources being used.&lt;br /&gt; /// &amp;lt;/summary&amp;gt;&lt;br /&gt; /// &amp;lt;param name=&quot;disposing&quot;&amp;gt;true if managed resources should be disposed; otherwise, false.&amp;lt;/param&amp;gt;&lt;br /&gt; protected override void Dispose(bool disposing)&lt;br /&gt; {&lt;br /&gt; if (disposing &amp;amp;&amp;amp; (components != null))&lt;br /&gt; {&lt;br /&gt; components.Dispose();&lt;br /&gt; }&lt;br /&gt; base.Dispose(disposing);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; #region Windows Form Designer generated code&lt;br /&gt;&lt;br /&gt; /// &amp;lt;summary&amp;gt;&lt;br /&gt; /// Required method for Designer support - do not modify&lt;br /&gt; /// the contents of this method with the code editor.&lt;br /&gt; /// &amp;lt;/summary&amp;gt;&lt;br /&gt; private void InitializeComponent()&lt;br /&gt; {&lt;br /&gt; this.SuspendLayout();&lt;br /&gt; // &lt;br /&gt; // Form1&lt;br /&gt; // &lt;br /&gt; this.AllowDrop = true;&lt;br /&gt; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt; this.BackColor = System.Drawing.SystemColors.ActiveCaption;&lt;br /&gt; this.ClientSize = new System.Drawing.Size(116, 49);&lt;br /&gt; this.Cursor = System.Windows.Forms.Cursors.Default;&lt;br /&gt; this.MaximizeBox = false;&lt;br /&gt; this.MinimizeBox = false;&lt;br /&gt; this.Name = &quot;Form1&quot;;&lt;br /&gt; this.Opacity = 0.75;&lt;br /&gt; this.ShowIcon = false;&lt;br /&gt; this.Text = &quot;Drop Box&quot;;&lt;br /&gt; this.TopMost = true;&lt;br /&gt; //this.Load += new System.EventHandler(this.Form1_Load);&lt;br /&gt; this.DragLeave += new System.EventHandler(this.Form1_DragLeave);&lt;br /&gt; this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);&lt;br /&gt; this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter);&lt;br /&gt; this.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);&lt;br /&gt; this.ResumeLayout(false);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; #endregion&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;'@&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-verbose&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ReferencedAssemblies&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;system.drawing&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;system.windows.forms&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Create our form object&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;New-object&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get_droppedfile.form1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Get rid of any events leftover&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;get-event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get-droppedfile&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-erroraction&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;silentlycontinue&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;remove-event&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Add handlers&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# The handlers transfer the action/file to the main loop using event&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;add_dragdrop&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;new-event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-sourceidentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get-droppedfile&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-messagedata&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$args&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Data&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;GetData&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;FileDrop&quot;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;add_formclosed&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;new-event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-sourceidentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get-droppedfile&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-messagedata&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;[close]&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;#Register-ObjectEvent -InputObject $form -EventName dragdrop #-SourceIdentifier blah#&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;#Register-ObjectEvent -InputObject $form -EventName formclosed #-SourceIdentifier blah&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Custom caption&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$caption&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$caption&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# This is the tricky part. Dropping is quite simple, but feeding the output pipeline with&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# the dropped files (so you do not have to wait until the drop box is closed) is not simple.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# I came up with this solution:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# - Do not use ShowDialog as is modal and will suspend PowerShell processing&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# - use Show and doevents in a loop&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# - this method consumes some CPU, but the Start-Sleep keeps it to a few per cent&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# - The Event actions generates events and they are read here in the main loop&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# and converted to file names which are sent to the pipeline&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Show the drop box&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#800000;&quot;&gt;do&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;get-event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get-droppedfile&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-erroraction&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;silentlycontinue&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# suppress no such events&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$exit&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;messagedata&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;[close]&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Test close message&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;messagedata&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$exit&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;MessageData&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Send file to pipeline&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$e&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;remove-event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Remove event from queue&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$exit&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;start-sleep&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-m&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Wait a little&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[System.Windows.Forms.Application]&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;doevents&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# React to form events so the windows can be moved etc.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Shutdown&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# end of script assignment&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Generate command for -sta recursive call. Done here where $myinvocation has the right value&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$command&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&amp;amp;'&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$myinvocation&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;mycommand&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;definition&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;' -caption '$caption' -_InternalReinvoked&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Execute the next in a scriptblock so output can be piped&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Forms must run in SingleThreadedApartment style&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Re-invoke PowerShell if necessary&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$host&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;runspace&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ApartmentState&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;-ne&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;sta&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;write-verbose&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Invoking PowerShell with -sta&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$bytes&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[System.Text.Encoding]&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Unicode&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;GetBytes&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$command&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$encodedCommand&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[Convert]&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ToBase64String&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$bytes&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;powershell.exe&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-sta&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-noprofile&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-encodedCommand&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$encodedCommand&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;#powershell -sta -noprofile $script&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$script&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Handle the different return options&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_InternalReinvoked&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ispresent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# -sta call, always return strings&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;elseif&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$recurse&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ispresent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;test-path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-pathtype&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;container&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:#006400;&quot;&gt;# Recurse folder tree, return text or objects&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-ChildItem&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-recurse&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-force&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$astext&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ispresent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;fullname&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;elseif&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$astext&lt;/span&gt;&lt;span style=&quot;color:#cd853f;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ispresent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#800000;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Item&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Have fun&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-3313553041104659080?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=xr7LyAmlKc4:4hnRubpt6yc:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=xr7LyAmlKc4:4hnRubpt6yc:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=xr7LyAmlKc4:4hnRubpt6yc:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=xr7LyAmlKc4:4hnRubpt6yc:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=xr7LyAmlKc4:4hnRubpt6yc:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/xr7LyAmlKc4&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-3313553041104659080</guid>
         <pubDate>Wed, 11 Nov 2009 02:22:00 -0800</pubDate>
      </item>
      <item>
         <title>PowerShell V2 now Available on Older Operating Systems</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/dGDHI731gzU/powershell-v2-now-available-on-older.html</link>
         <description>&lt;p&gt;Now you can safely forget V1 and switch to the vastly superior V2. As of last week it is now available on -&lt;/p&gt; Windows Server 2008 with Service Pack 2  Windows Server 2003 with Service Pack 2  Windows Vista with Service Pack 2  Windows Vista with Service Pack 1  Windows XP with Service Pack 3 &lt;p&gt;In Windows 7 and WS08 R2 it is part of the package.&lt;/p&gt; &lt;p&gt;PS2 is part of Windows Management Framework which also includes WinRM and BITS4.&lt;/p&gt; &lt;p&gt;BTW: You need to install PowerShell 2 on server core. Read how in KB &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://support.microsoft.com/?kbid=976736&quot;&gt;976736&lt;/a&gt;.&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-7257898099681224667?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=dGDHI731gzU:kisN0YVjv5Y:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=dGDHI731gzU:kisN0YVjv5Y:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=dGDHI731gzU:kisN0YVjv5Y:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=dGDHI731gzU:kisN0YVjv5Y:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=dGDHI731gzU:kisN0YVjv5Y:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/dGDHI731gzU&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-7257898099681224667</guid>
         <pubDate>Mon, 02 Nov 2009 01:50:00 -0800</pubDate>
      </item>
      <item>
         <title>DFS, IPv6 and – sort of – disabling it</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/Gu5DxwNsx2c/dfs-ipv6-and-sort-of-disabling-it.html</link>
         <description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; title=&quot;Ask the Directory Services Team&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/askds/default.aspx&quot;&gt;Ask the Directory Services Team&lt;/a&gt; has a good article on troubleshooting DFS links (&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/askds/archive/2009/10/28/dfs-referrals-and-ipv6-outta-site.aspx&quot;&gt;DFS Referrals and IPv6: Outta site!&lt;/a&gt;) as well as a discussion of how not to&amp;#160; disable IPv6 (unbinding it from an adapter) and how to do it correctly (&lt;a rel=&quot;nofollow&quot; title=&quot;KB929852&quot; target=&quot;_blank&quot; href=&quot;http://support.microsoft.com/default.aspx?scid=kb;EN-US;929852&quot;&gt;KB929852&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;In case you really need to disable IPv6, consider using a Group Policy Preference or automate it with PowerShell -&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;Set-ItemProperty HKLM:&amp;#92;SYSTEM&amp;#92;CurrentControlSet&amp;#92;Services&amp;#92;Tcpip6&amp;#92;Parameters DisabledComponents 0xffffffff -type dword&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Useful information.&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-5664375701820279607?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Gu5DxwNsx2c:VKdUvmjmIxI:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Gu5DxwNsx2c:VKdUvmjmIxI:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Gu5DxwNsx2c:VKdUvmjmIxI:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Gu5DxwNsx2c:VKdUvmjmIxI:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Gu5DxwNsx2c:VKdUvmjmIxI:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/Gu5DxwNsx2c&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-5664375701820279607</guid>
         <pubDate>Mon, 02 Nov 2009 00:22:00 -0800</pubDate>
      </item>
      <item>
         <title>Executing a PowerShell Pipeline from your own program</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/dqXUhP5tG14/executing-powershell-pipeline-from-your.html</link>
         <description>&lt;p&gt;In &lt;a rel=&quot;nofollow&quot; title=&quot;Executing PowerShell code from within your own program&quot; target=&quot;_blank&quot; href=&quot;http://msgoodies.blogspot.com/2009/10/executing-powershell-code-from-within.html&quot;&gt;Executing PowerShell code from within your own program&lt;/a&gt; I showed how to execute PowerShell code, but the interface was rather rude as the value had to be converted to string and added to the script code involved. If you have lots of objects to proces, this method is inefficient – a pipeline would be much better as the script source only has to be parsed once and the script would be able to access the objects as real objects.&lt;/p&gt; &lt;p&gt;I have now taken it a step further and created a piece of code that can execute a pipeline. If you have lots of objects – ‘lots’ depends on the amount of memory you have available – this may not be the most efficient method. All input and output objects will be represented as List&amp;lt;PSObject&amp;gt; giving some overhead. An alternative would be to use a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/system.management.automation.steppablepipeline(VS.85).aspx&quot;&gt;steppable pipeline&lt;/a&gt; but for now, I’ll stick to the easy method.&lt;/p&gt; &lt;p&gt;Here’s the code&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:119.21%;padding-right:0px;direction:ltr;border-top-style:none;height:702px;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;class&lt;/span&gt; PSHost&lt;br /&gt;{&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;private&lt;/span&gt; PSDataStreams _InvokePipeline(&lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt; Script,&lt;br /&gt; List&amp;lt;PSObject&amp;gt; inputPipeline,&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;out&lt;/span&gt; Collection&amp;lt;PSObject&amp;gt; outputPipeline)&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt; PowerShell PS = PowerShell.Create();&lt;br /&gt; PS.AddScript(Script);&lt;br /&gt;&lt;br /&gt; outputPipeline=PS.Invoke&amp;lt;PSObject&amp;gt;(inputPipeline);&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;return&lt;/span&gt; PS.Streams;&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt; _ConvertStreamsToString(PSDataStreams streams)&lt;br /&gt; {&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt; s = &lt;span style=&quot;color:#006080;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (DebugRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Debug)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;DEBUG: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (VerboseRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Verbose)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;VERBOSE: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (WarningRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Warning)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;WARNING: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (ErrorRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Error)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;ERROR: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;return&lt;/span&gt; s;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt; PSExecutePipeline(&lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt; Script,&lt;br /&gt; List&amp;lt;PSObject&amp;gt; inputPipeline,&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;out&lt;/span&gt; Collection&amp;lt;PSObject&amp;gt; outputPipeline)&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt; PSDataStreams ds = _InvokePipeline(Script, inputPipeline, &lt;span style=&quot;color:#0000ff;&quot;&gt;out&lt;/span&gt; outputPipeline);&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;return&lt;/span&gt; _ConvertStreamsToString(ds);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;br /&gt;The script must include $input to pick up the values – if any. The streams collection is returned as a string, so you can check for warning/error/verbose/debug/progress output. Parsing errors will throw an exception; you would use a try-catch to handle that. Naturally, you can change the interface to your own requirements.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that output objects may be real objects with properties or just simple value types. A property value can be retrieved with p.property[“propertyname”].value and a simple with p.BaseObject.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Example 1 – summing numbers&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#008000;&quot;&gt;// Input pipeline&lt;/span&gt;&lt;br /&gt;List&amp;lt;PSObject&amp;gt; numbers = &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; List&amp;lt;PSObject&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#008000;&quot;&gt;// Add values/objects&lt;/span&gt;&lt;br /&gt;numbers.Add(&lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; PSObject(1));&lt;br /&gt;numbers.Add(&lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; PSObject(2));&lt;br /&gt;numbers.Add(&lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; PSObject(3));&lt;br /&gt;numbers.Add(&lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; PSObject(4));&lt;br /&gt;numbers.Add(&lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; PSObject(5));&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#008000;&quot;&gt;// Output pipeline&lt;/span&gt;&lt;br /&gt;System.Collections.ObjectModel.Collection&amp;lt;PSObject&amp;gt; outputPipeline;&lt;br /&gt;&lt;br /&gt;PSHost psh = &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; PSHost();&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt; s = psh.PSExecutePipeline(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;$input | measure-object -sum&quot;&lt;/span&gt;, numbers, &lt;span style=&quot;color:#0000ff;&quot;&gt;out&lt;/span&gt; outputPipeline);&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(s))&lt;br /&gt;{&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (PSObject p &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; outputPipeline)&lt;br /&gt; {&lt;br /&gt; System.Diagnostics.Debug.WriteLine(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;Sum is &quot;&lt;/span&gt; + p.Properties[&lt;span style=&quot;color:#006080;&quot;&gt;&quot;Sum&quot;&lt;/span&gt;].Value.ToString());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt; System.Diagnostics.Debug.WriteLine(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;PowerShell failed: &quot;&lt;/span&gt; + s);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Example 2 demonstrates how to return a value type&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#008000;&quot;&gt;// Re-uses the variable from example 1&lt;/span&gt;&lt;br /&gt;List&amp;lt;PSObject&amp;gt; empty = &lt;span style=&quot;color:#0000ff;&quot;&gt;new&lt;/span&gt; List&amp;lt;PSObject&amp;gt;();&lt;br /&gt;s = psh.PSExecutePipeline(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;100&quot;&lt;/span&gt;, empty, &lt;span style=&quot;color:#0000ff;&quot;&gt;out&lt;/span&gt; outputPipeline);&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:#0000ff;&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(s))&lt;br /&gt;{&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (PSObject p &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; outputPipeline)&lt;br /&gt; {&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;if&lt;/span&gt; (p.BaseObject.GetType().IsValueType)&lt;br /&gt; {&lt;br /&gt; System.Diagnostics.Debug.WriteLine(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;Number is &quot;&lt;/span&gt; + p.BaseObject.ToString());&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;else&lt;/span&gt;&lt;br /&gt; {&lt;br /&gt; System.Diagnostics.Debug.WriteLine(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;Number is &quot;&lt;/span&gt; + p.Properties[&lt;span style=&quot;color:#006080;&quot;&gt;&quot;Value&quot;&lt;/span&gt;].Value.ToString());&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt; System.Diagnostics.Debug.WriteLine(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;PowerShell failed: &quot;&lt;/span&gt; + s);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Debug output can be seen with &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://live.sysinternals.com/DbgView.exe&quot;&gt;DbgView&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Have fun&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-1738893796067922817?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=dqXUhP5tG14:c05SRvx3I5I:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=dqXUhP5tG14:c05SRvx3I5I:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=dqXUhP5tG14:c05SRvx3I5I:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=dqXUhP5tG14:c05SRvx3I5I:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=dqXUhP5tG14:c05SRvx3I5I:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/dqXUhP5tG14&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-1738893796067922817</guid>
         <pubDate>Fri, 30 Oct 2009 02:51:00 -0700</pubDate>
      </item>
      <item>
         <title>Using ILM for DMZ Account Management</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/Z4-rNwwvGtY/using-ilm-for-dmz-account-management.html</link>
         <description>&lt;p&gt;When you need to manage your users and group in a DMZ, it can be done in several ways. At least these methods can be used -&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Autonomous. All users and groups are maintained locally in the DMZ. &lt;/li&gt; &lt;li&gt;Forest trust. A forest trust is constructed so the DMZ forest trust internal accounts. To restrict. &lt;/li&gt; &lt;li&gt;Read-only Domain Controller. A RODC is deployed in the DMZ. &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Besides these, ILM can also be used and when you read the advantages/disadvantages below, you may or may not decide that ILM is the best for your environment.&lt;/p&gt; &lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; width=&quot;100%&quot;&gt;&lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;Autonomous&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Can be totally isolated &lt;/li&gt; &lt;li&gt;No firewall setup &lt;/li&gt; &lt;li&gt;No information leak from internal AD &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Expensive owing to added administration&lt;/li&gt; &lt;li&gt;Distributed administration &lt;/li&gt; &lt;li&gt;No SSO &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;Forest trust&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Good integration with internal AD &lt;/li&gt; &lt;li&gt;SSO with Kerberos &lt;/li&gt; &lt;li&gt;Access to DMZ for internal AD objects can be restricted with Selective authentication &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Complex firewall setup &lt;/li&gt; &lt;li&gt;Cannot pick internal objects with GUI picker (unless you open for LDAP from non-DC) &lt;/li&gt; &lt;li&gt;Have to change the registry to allow RDP logon on WS03. See &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://support.microsoft.com/default.aspx/kb/902336&quot;&gt;KB 902336&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;Read-only domain controller&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;A single forest &lt;/li&gt; &lt;li&gt;SSO &lt;/li&gt; &lt;li&gt;Exposure can be controlled by managing what sensitive properties are on the RODC &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Windows Server 2008 only &lt;/li&gt; &lt;li&gt;Complex control of updates like DDNS &lt;/li&gt; &lt;li&gt;Cannot limit users and groups visible &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;ILM&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Simple firewall setup &lt;/li&gt; &lt;li&gt;No inbound firewall rules &lt;/li&gt; &lt;li&gt;No ILM license if you use &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=D9143610-C04D-41C4-B7EA-6F56819769D5&amp;amp;displaylang=en&quot;&gt;IIFP&lt;/a&gt; (Enterprise Edition is required). See more below.&lt;/li&gt; &lt;li&gt;Single place of management in the internal AD. Everything is pushed to DMZ including password changes. Helpdesk does not need access to DMZ and not even special procedures for changing properties.&lt;/li&gt; &lt;li&gt;Full control of what object that are visible in DMZ &lt;/li&gt; &lt;li&gt;No leak of other objects (trust cannot be queried) &lt;/li&gt; &lt;li&gt;SSO or at least same password &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;ul&gt; &lt;li&gt;Requires an extra infrastructure component &lt;/li&gt; &lt;li&gt;SQL license (unless existing can be used) &lt;/li&gt; &lt;li&gt;May not have full SSO to all services (re-enter password) &lt;/li&gt; &lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;h2&gt;&lt;/h2&gt; &lt;p&gt;The seems fine, you say. I know how to do the other stuff, how complex is it to implement the ILM solution? Well, with ILM 2007 you have to create at least some code or get the code from someone who have made it (like Inceptio). But besides this, the rest is standard components. A very rough plan looks like this -&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Install ILM&lt;/li&gt; &lt;li&gt;Install and configure &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=ae09d2f5-8ac2-4769-ab6a-48fe35a25c63&amp;amp;DisplayLang=en&quot;&gt;PCNS&lt;/a&gt; on the internal AD domain controllers to capture password changes&lt;/li&gt; &lt;li&gt;Enable password management in ILM&lt;/li&gt; &lt;li&gt;Create an DMZ AD management agent, specifying it as password target&lt;/li&gt; &lt;li&gt;Create an internal AD management agent. Specify it as password source and the DMZ AD Management Agent as target&lt;/li&gt; &lt;li&gt;Create a management agent that can figure out what objects should be replicated to DMZ (use a group membership, naming convention or some other property). Let this populate an expectedDN property. If the logic is simple, it could be done in an MVExtension. In the solution I have made, I have done it using attribute-value-property files and PowerShell code.&lt;/li&gt; &lt;li&gt;Flow the properties you want to keep in sync from the internal AD and export them to the DMZ AD&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;With Forefront Identity Manager (FIM) 2010, you should be able to get rid of the coding part, making the solution more attractive. When it comes to IIFP, that is not supported anymore. Microsoft removed the download at some time but made it available again. From my sources at Microsoft, no IIFP version of FIM will be available, so you have to buy it.&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-6789606272484064459?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Z4-rNwwvGtY:ag3aZHgz9Ns:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Z4-rNwwvGtY:ag3aZHgz9Ns:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Z4-rNwwvGtY:ag3aZHgz9Ns:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Z4-rNwwvGtY:ag3aZHgz9Ns:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Z4-rNwwvGtY:ag3aZHgz9Ns:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/Z4-rNwwvGtY&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-6789606272484064459</guid>
         <pubDate>Thu, 29 Oct 2009 03:06:00 -0700</pubDate>
      </item>
      <item>
         <title>Executing PowerShell code from within your own program</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/Wbxj6Gc-OJY/executing-powershell-code-from-within.html</link>
         <description>&lt;p&gt;In V2 this got a lot easier. Here’s my PSExecute function. The idea is that you send in a text value and a script. The script references the value as $_. All output from the script is returned as the result of PSExecute. Exceptions (e.g. syntax errors), errors etc. are returned as well. Depending on the usage, this may not be what you need, but you can change it yourself.&lt;/p&gt; &lt;p&gt;I’m planning to use this in combination with ILM. Having the ability to use a piece of PowerShell script in an advanced flow rule or in the MVExtension seems very useful.&lt;/p&gt; &lt;p&gt;A script could be $_.toupper() etc.&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;private&lt;/span&gt; String PSExecute(String Script, String InputValue)&lt;br /&gt;{&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;// Create PS outside the function if called multiple times for performance reasons&lt;/span&gt;&lt;br /&gt; PowerShell PS = PowerShell.Create(); &lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;// The script could probably be parsed once to speed things up if the same script is used repeatably&lt;/span&gt;&lt;br /&gt; PS.AddScript(&lt;span style=&quot;color:#006080;&quot;&gt;&quot;'&quot;&lt;/span&gt; + InputValue + &lt;span style=&quot;color:#006080;&quot;&gt;&quot;' | foreach {&quot;&lt;/span&gt; + Script + &lt;span style=&quot;color:#006080;&quot;&gt;&quot;}&quot;&lt;/span&gt;);&lt;br /&gt; String s = &lt;span style=&quot;color:#006080;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;try&lt;/span&gt;&lt;br /&gt; {&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (PSObject result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Invoke())&lt;br /&gt; {&lt;br /&gt; s += result.ToString();&lt;br /&gt; } &lt;span style=&quot;color:#008000;&quot;&gt;// End foreach.&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;catch&lt;/span&gt; (Exception e)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;EXCEPTION: &quot;&lt;/span&gt; + e.Message; &lt;span style=&quot;color:#008000;&quot;&gt;// ToString();&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color:#008000;&quot;&gt;// just continue&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (DebugRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Debug)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;DEBUG: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (VerboseRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Verbose)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;VERBOSE: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (WarningRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Warning)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;WARNING: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&lt;/span&gt; (ErrorRecord result &lt;span style=&quot;color:#0000ff;&quot;&gt;in&lt;/span&gt; PS.Streams.Error)&lt;br /&gt; {&lt;br /&gt; s += &lt;span style=&quot;color:#006080;&quot;&gt;&quot;ERROR: &quot;&lt;/span&gt; + result.ToString();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;color:#0000ff;&quot;&gt;return&lt;/span&gt; s;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you want to try it from PowerShell first, here’s the statements -&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;$&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;=&lt;span style=&quot;color:#006080;&quot;&gt;'$input | fforeach {$_.toupper()}'&lt;/span&gt;&lt;br /&gt;$&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt;=&lt;span style=&quot;color:#006080;&quot;&gt;'$_.toupper()'&lt;/span&gt;&lt;br /&gt;$ps=[System.Management.Automation.powershell]::create()&lt;br /&gt;$ps.AddScript(&lt;span style=&quot;color:#006080;&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;''&lt;/span&gt; + $Inputvalue + &lt;span style=&quot;color:#006080;&quot;&gt;''&lt;/span&gt;&lt;span style=&quot;color:#006080;&quot;&gt;' | foreach {'&lt;/span&gt; + $&lt;span style=&quot;color:#0000ff;&quot;&gt;script&lt;/span&gt; + &lt;span style=&quot;color:#006080;&quot;&gt;'}'&lt;/span&gt;)&lt;br /&gt;$ps.invoke()&lt;br /&gt;$ps.Streams&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Have fun!&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-17541519921698895?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Wbxj6Gc-OJY:-Xy9gmoKri8:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Wbxj6Gc-OJY:-Xy9gmoKri8:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Wbxj6Gc-OJY:-Xy9gmoKri8:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=Wbxj6Gc-OJY:-Xy9gmoKri8:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=Wbxj6Gc-OJY:-Xy9gmoKri8:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/Wbxj6Gc-OJY&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-17541519921698895</guid>
         <pubDate>Mon, 26 Oct 2009 07:31:00 -0700</pubDate>
      </item>
      <item>
         <title>Getting PowerShell V2 SDK</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/AdTsVzBLdhk/getting-powershell-v2-sdk.html</link>
         <description>&lt;p&gt;Messing around to find it, I’ll make it easier for you!&lt;/p&gt; &lt;p&gt;Unlike V1, the SDK is not a separate download, but part of &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&amp;amp;displaylang=en&quot;&gt;Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1&lt;/a&gt;. After installing it (you can exclude the Win32 parts), add references to the relevant DLLs found in C:&amp;#92;Program Files&amp;#92;Reference Assemblies&amp;#92;Microsoft&amp;#92;WindowsPowerShell&amp;#92;v1.0.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;p&gt;Have fun&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-4234762633325203313?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=AdTsVzBLdhk:G7zbQA1a-38:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=AdTsVzBLdhk:G7zbQA1a-38:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=AdTsVzBLdhk:G7zbQA1a-38:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=AdTsVzBLdhk:G7zbQA1a-38:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=AdTsVzBLdhk:G7zbQA1a-38:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/AdTsVzBLdhk&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-4234762633325203313</guid>
         <pubDate>Mon, 26 Oct 2009 06:54:00 -0700</pubDate>
      </item>
      <item>
         <title>Using a PS Session without having Administrative Permissions</title>
         <link>http://feedproxy.google.com/~r/blogspot/msgoodies/~3/sKczEI9et6k/using-ps-session-without-having.html</link>
         <description>&lt;p&gt;One of the great features of PowerShell V2 is the remote session support. But in the default configuration only local administrators can create a remote session. This is what a normal user sees -&lt;/p&gt; &lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://lh6.ggpht.com/_HE3RrxmeZ90/SrVHABRE4KI/AAAAAAAAAGk/OhA-W420jnQ/s1600-h/image%5B20%5D.png&quot;&gt;&lt;img style=&quot;border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh3.ggpht.com/_HE3RrxmeZ90/SrVHAgrryKI/AAAAAAAAAGo/OO1Jja4GstA/image_thumb%5B10%5D.png?imgmax=800&quot; width=&quot;822&quot; height=&quot;119&quot;/&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;This is how you delegate the feature to other users – the easy way.&lt;/p&gt; &lt;p&gt;First, create a local group and insert the user(s)&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;net localgroup &lt;span style=&quot;color:#006080;&quot;&gt;&quot;PowerShell Session Users&quot;&lt;/span&gt; /add&lt;br /&gt;net localgroup &lt;span style=&quot;color:#006080;&quot;&gt;&quot;PowerShell Session Users&quot;&lt;/span&gt; the-user /add&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Second, execute this command to bring up the permissions GUI&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt; &lt;pre style=&quot;border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;direction:ltr;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;&quot; id=&quot;codeSnippet&quot;&gt;Set-PSSessionConfiguration microsoft.powershell -ShowSecurityDescriptorUI&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;add the group and grant execute (invoke) permissions -&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://lh6.ggpht.com/_HE3RrxmeZ90/SrVHBHLoRUI/AAAAAAAAAGs/lIOsgAuzSJs/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img style=&quot;border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_HE3RrxmeZ90/SrVHBxIRLFI/AAAAAAAAAGw/5SWAuMAKgz8/image_thumb%5B1%5D.png?imgmax=800&quot; width=&quot;365&quot; height=&quot;439&quot;/&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that you have to restart the service -&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://lh4.ggpht.com/_HE3RrxmeZ90/SrVHCOae7TI/AAAAAAAAAG0/CjeXZ_g1PWk/s1600-h/image%5B21%5D.png&quot;&gt;&lt;img style=&quot;border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_HE3RrxmeZ90/SrVHCuD-d6I/AAAAAAAAAG4/r4XQVOIxSTY/image_thumb%5B11%5D.png?imgmax=800&quot; width=&quot;705&quot; height=&quot;291&quot;/&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And finally, try it out.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://lh4.ggpht.com/_HE3RrxmeZ90/SrVHCzvP5YI/AAAAAAAAAG8/YQpf-agoPWQ/s1600-h/image%5B16%5D.png&quot;&gt;&lt;img style=&quot;border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://lh6.ggpht.com/_HE3RrxmeZ90/SrVHDa9bjkI/AAAAAAAAAHA/R9wHxtsRsC0/image_thumb%5B8%5D.png?imgmax=800&quot; width=&quot;648&quot; height=&quot;131&quot;/&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Let me draw your attention to two things in the picture above. First, the remote command is executed by a wsmprovhost process and second, extra properties are returned even though only the processname was selected. The extra properties are useful if you execute command on multiple sessions. In this way, you can recognize the returned objects.&lt;/p&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8600848-3094476750399726357?l=msgoodies.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=sKczEI9et6k:TLTkcSFEIcY:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?d=yIl2AUoC8zA&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=sKczEI9et6k:TLTkcSFEIcY:F7zBnMyn0Lo&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=sKczEI9et6k:TLTkcSFEIcY:F7zBnMyn0Lo&quot; border=&quot;0&quot;&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?a=sKczEI9et6k:TLTkcSFEIcY:V_sGLiPBpWU&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/blogspot/msgoodies?i=sKczEI9et6k:TLTkcSFEIcY:V_sGLiPBpWU&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/msgoodies/~4/sKczEI9et6k&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Per Østergaard</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-8600848.post-3094476750399726357</guid>
         <pubDate>Sat, 19 Sep 2009 16:03:00 -0700</pubDate>
      </item>
   </channel>
</rss>
<!-- fe5.pipes.sp1.yahoo.com uncompressed/chunked Tue Nov 24 06:31:40 PST 2009 -->
