<?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>PowerShell Bloggers</title>
      <description>Two weeks (max) worth of chronologically merged posts from a selection of PowerShell bloggers</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=uAmYy9xq3BGHcV361fC6Jw</link>
      <pubDate>Sun, 22 Nov 2009 17:42:36 -0800</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>Creating an Access database</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2646.entry</link>
         <description>&lt;p&gt;I’ve blogged a bit about using SQL Server with PowerShell, and using Word and Excel through PowerShell. I realised that I hadn’t seen much about using Access. Access is part of the Office suite and is present on many desktops. It forms a handy data store for using with PowerShell.&lt;/p&gt; &lt;p&gt;In this series of articles I’ll show how to work with data contained in Access databases using PowerShell.&lt;/p&gt; &lt;p&gt;First job is to create a database.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:812px;padding-right:5px;font-family:consolas, lucida console;height:398px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;019&lt;br /&gt;020&lt;br /&gt;021&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;New-AccessDatabase&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:#00008b;&quot;&gt;param&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:#008080;&quot;&gt;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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;[switch]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$acc7&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;if&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:#a9a9a9;&quot;&gt;!&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; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&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;{&lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;Throw&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Invaild Folder&quot;&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;$file&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Join-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ChildPath&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$name&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:#00008b;&quot;&gt;if&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:#0000ff;&quot;&gt;Test-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$file&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:#00008b;&quot;&gt;Throw&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File Already Exists&quot;&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$cat&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ComObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;'ADOX.Catalog'&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:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$acc7&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;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$cat&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Provider=Microsoft.ACE.OLEDB.12.0; Data Source=$file&quot;&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:#00008b;&quot;&gt;else&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:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-match&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&amp;#92;.accdb&quot;&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;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$cat&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Provider=Microsoft.ACE.OLEDB.12.0; Data Source=$file&quot;&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; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;else&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:#ff4500;&quot;&gt;$cat&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$file&quot;&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;}&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:#ff4500;&quot;&gt;$cat&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ActiveConnection&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;My function takes three parameters – a file name, a path and switch. The path is tested and the function aborts if the folder isn’t available. Likewise if the file already exists in that folder an error is thrown.&lt;/p&gt; &lt;p&gt;If the –aac7 switch is set I want to create an Access 2007 database with an .mdb extension. Otherwise if the extension is .accdb an Access 2007 database is created. if the extension is .mdb without the –acc7 switch an Access 2002-2003 file is created. These examples illustrate the choices.&lt;/p&gt; &lt;p&gt;To create database with Access 2002-2003 file format&lt;/p&gt; &lt;p&gt;New-AccessDatabase -name test03.mdb -path c:&amp;#92;test&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;To create database with Access 2007 file format&lt;/p&gt; &lt;p&gt;New-AccessDatabase -name test07.mdb -path c:&amp;#92;test -acc7&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;To create database with Access 2007 accdb file format&lt;/p&gt; &lt;p&gt;New-AccessDatabase -name atest07.accdb -path c:&amp;#92;test&lt;/p&gt; &lt;p&gt;I’m using the providers loaded with Office 2010. The &lt;span style=&quot;color:#8b0000;&quot;&gt;Microsoft.ACE.OLEDB.12.0&lt;/span&gt; provider is delivered with Office 2007 SP1 or can be downloaded from &lt;a rel=&quot;nofollow&quot; title=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&amp;amp;displaylang=en&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&amp;amp;displaylang=en&quot;&gt;http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now we’ve created our database the next job is to create some tables.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Access&quot;&gt;Access&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2646</guid>
         <pubDate>Sun, 22 Nov 2009 19:06:13 -0800</pubDate>
         <media:content></media:content>
         <category>Powershell</category>
      </item>
      <item>
         <title>WMICookbook: Read Routing Table</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2639.entry</link>
         <description>&lt;p&gt;When we need to troubleshoot networking problems we will sometimes need to read the routing table on a machine. The routing table contains the information on the routes known to the network interfaces. This can be created automatically or manually . On the local machine we can use the route command to find this information – but how do we find it on a remote machine. WMI has a class that enables us to read the routing table. &lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:623px;padding-right:5px;font-family:consolas, lucida console;height:1124px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;019&lt;br /&gt;020&lt;br /&gt;021&lt;br /&gt;022&lt;br /&gt;023&lt;br /&gt;024&lt;br /&gt;025&lt;br /&gt;026&lt;br /&gt;027&lt;br /&gt;028&lt;br /&gt;029&lt;br /&gt;030&lt;br /&gt;031&lt;br /&gt;032&lt;br /&gt;033&lt;br /&gt;034&lt;br /&gt;035&lt;br /&gt;036&lt;br /&gt;037&lt;br /&gt;038&lt;br /&gt;039&lt;br /&gt;040&lt;br /&gt;041&lt;br /&gt;042&lt;br /&gt;043&lt;br /&gt;044&lt;br /&gt;045&lt;br /&gt;046&lt;br /&gt;047&lt;br /&gt;048&lt;br /&gt;049&lt;br /&gt;050&lt;br /&gt;051&lt;br /&gt;052&lt;br /&gt;053&lt;br /&gt;054&lt;br /&gt;055&lt;br /&gt;056&lt;br /&gt;057&lt;br /&gt;058&lt;br /&gt;059&lt;br /&gt;060&lt;br /&gt;061&lt;br /&gt;062&lt;br /&gt;063&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Get-RouteTable&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:#00008b;&quot;&gt;param&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:#a9a9a9;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#add8e6;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ValueFromPipeline&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;span style=&quot;color:#a9a9a9;&quot;&gt;]&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;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$computer&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;.&quot;&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 class for object&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$source&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;@&quot;&lt;br /&gt;public class WmiIPRoute&lt;br /&gt;{&lt;br /&gt; private string _destination;&lt;br /&gt; private string _mask;&lt;br /&gt; private string _nexthop;&lt;br /&gt; private string _interface;&lt;br /&gt; private int _metric;&lt;br /&gt; &lt;br /&gt; public string Destination {&lt;br /&gt; get {return _destination;}&lt;br /&gt; set {_destination = value;}&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public string Mask {&lt;br /&gt; get {return _mask;}&lt;br /&gt; set {_mask = value;}&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public string NextHop {&lt;br /&gt; get {return _nexthop;}&lt;br /&gt; set {_nexthop = value;}&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public string Interface {&lt;br /&gt; get {return _interface;}&lt;br /&gt; set {_interface = value;}&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public int Metric {&lt;br /&gt; get {return _metric;}&lt;br /&gt; set {_metric = value;}&lt;br /&gt; } &lt;br /&gt;}&lt;br /&gt;&quot;@&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Add-Type&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-TypeDefinition&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$source&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:#ff4500;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;)&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-WmiObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Class&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Win32_IP4RouteTable&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ComputerName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$computer&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#ff4500;&quot;&gt;$route&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-TypeName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;WmiIPRoute&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;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Destination&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Destination&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;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Mask&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Mask&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;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;NextHop&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;NextHop&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;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Metric&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Metric1&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:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$filt&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;InterfaceIndex='&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;+&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;InterfaceIndex&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;'&quot;&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;$ip&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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:#0000ff;&quot;&gt;Get-WmiObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Class&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Win32_NetworkAdapterConfiguration&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Filter&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$filt&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ComputerName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$computer&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;IPAddress&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:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;InterfaceIndex&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interface&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;127.0.0.1&quot;&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:#00008b;&quot;&gt;elseif&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:#ff4500;&quot;&gt;$ip&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;2&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:#ff4500;&quot;&gt;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interface&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ip&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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:#00008b;&quot;&gt;else&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:#ff4500;&quot;&gt;$route&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interface&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ip&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$route&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:#ff4500;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Format-Table&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-AutoSize&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Our function takes a single parameter – a computer name (or IP address) I’ve used the advanced function parameters to this function operates on the pipeline. We then create a .NET class to hold our data – we will be accessing a couple of WMI classes so we’ll make the presentation neat. The class is added using Add-Type.&lt;/p&gt; &lt;p&gt;As an aside I really like this technique for collecting data together into a single object. Its neater and easier to use than Add-Member.&lt;/p&gt; &lt;p&gt;We can then use Get-WmiObject -Class Win32_IP4RouteTable -ComputerName $computer to retrieve the routing information. We create an instance of our object and populate the properties. One thing we need to know is the Interface ie which address on our machine is using this route, We can find this from the Win32_NetworkAdapterConfiguration class. There isn’t an association but we can find the address by using the InterfaceIndex as a filter – its the same value in both classes. if the InterfaceIndex = 1 its the Loopback Adapter on 127.0.0.1&lt;/p&gt; &lt;p&gt;We can then add our route to the data. When all the routes are collected we can display the data. The data could be output onto the pipeline but at the moment I can’t think what else to do with it so we’ll leave it like this for now.&lt;/p&gt; &lt;p&gt;Note: Win32_IP4RouteTable is only available on Windows 2003 and later&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/WMI&quot;&gt;WMI&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Networking&quot;&gt;Networking&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Routing+Table&quot;&gt;Routing Table&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2639</guid>
         <pubDate>Fri, 20 Nov 2009 16:57:20 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell and WMI</category>
      </item>
      <item>
         <title>Testing for PowerShell Remoting: Test-PsRemoting</title>
         <link>http://www.leeholmes.com/blog/TestingForPowerShellRemotingTestPsRemoting.aspx</link>
         <description>&lt;p&gt;
When you’re writing a script that depends on PowerShell Remoting, it’s often helpful
to know that the remoting channel is open and will support the activities of your
script.
&lt;/p&gt;
&lt;p&gt;
PowerShell has a Test-WSMan command, but that only verifies that a WSMan connection
is possible. There are other scenarios you could be impacted by:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Not having permission on the remote machine&lt;/li&gt;
&lt;li&gt;
Misconfiguration of the PowerShell endpoint&lt;/li&gt;
&lt;li&gt;
Corrupted installation&lt;/li&gt;
&lt;li&gt;
(etc)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
As you dig deeper, you realize that the only way to really test the viability of the
remoting channel is to just do something on it, and verify that you got the results
you expected to. Since the implementation was so simple, we didn’t write a cmdlet
for it. In retrospect, the concept is more difficult than the implementation, so we
probably should have written it anyways. Here’s an example function that tests the
remoting connection to a specific machine.
&lt;/p&gt;
&lt;blockquote&gt; &lt;table style=&quot;margin-left:32.25pt;&quot; class=&quot;MsoNormalTable&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr style=&quot;&quot;&gt;
&lt;td style=&quot;padding-bottom:3.75pt;padding-left:3.75pt;padding-right:3.75pt;padding-top:3.75pt;&quot; valign=&quot;top&quot;&gt;
&lt;p style=&quot;background:#cecece;&quot; class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family:consolas;font-size:10pt;&quot;&gt;001 &lt;br /&gt;
002 &lt;br /&gt;
003 &lt;br /&gt;
004 &lt;br /&gt;
005 &lt;br /&gt;
006 &lt;br /&gt;
007 &lt;br /&gt;
008 &lt;br /&gt;
009 &lt;br /&gt;
010 &lt;br /&gt;
011 &lt;br /&gt;
012 &lt;br /&gt;
013 &lt;br /&gt;
014 &lt;br /&gt;
015 &lt;br /&gt;
016 &lt;br /&gt;
017 &lt;br /&gt;
018 &lt;br /&gt;
019 &lt;br /&gt;
020 &lt;br /&gt;
021 &lt;br /&gt;
022 &lt;br /&gt;
023 &lt;br /&gt;
024 &lt;br /&gt;
025 &lt;br /&gt;
026 &lt;br /&gt;
027 &lt;br /&gt;
028&lt;/span&gt; &lt;p&gt;
&lt;/p&gt;
&amp;gt;
&lt;/td&gt;
&lt;td style=&quot;padding-bottom:3.75pt;padding-left:3.75pt;padding-right:3.75pt;padding-top:3.75pt;&quot; valign=&quot;top&quot; nowrap&gt;
&lt;p style=&quot;background:#fcfcfc;&quot; class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family:consolas;color:darkblue;font-size:10pt;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;font-family:consolas;color:black;font-size:10pt;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;font-family:consolas;color:blueviolet;font-size:10pt;&quot;&gt;Test-PsRemoting&lt;/span&gt;&lt;span style=&quot;font-family:consolas;font-size:10pt;&quot;&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;{&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkblue;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;(&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkgray;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:lightblue;&quot;&gt;Parameter&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;(Mandatory &lt;/span&gt;&lt;span style=&quot;color:darkgray;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:darkgray;&quot;&gt;]&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$computername&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; )&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkblue;&quot;&gt;try&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$errorActionPreference&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:darkgray;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:darkred;&quot;&gt;&quot;Stop&quot;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:darkgray;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;Invoke-Command&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:navy;&quot;&gt;-ComputerName&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$computername&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:purple;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt; }&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkblue;&quot;&gt;catch&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;Write-Verbose&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$_&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkblue;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$false&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkgreen;&quot;&gt;##
I've never seen this happen, but if you want to be&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkgreen;&quot;&gt;##
thorough....&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkblue;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:darkgray;&quot;&gt;-ne&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:purple;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;)&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;Write-Verbose&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:darkred;&quot;&gt;&quot;Remoting
to $computerName returned an unexpected result.&quot;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:darkblue;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$false&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color:orangered;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color:black;&quot;&gt;}&lt;/span&gt; &lt;/span&gt; &lt;p&gt;
&lt;/p&gt;
&amp;gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/blockquote&gt;&lt;img width=&quot;0&quot; height=&quot;0&quot; src=&quot;http://www.leeholmes.com/blog/aggbug.ashx?id=8fd96bcb-e391-4389-829b-71f9f67f863d&quot;/&gt;</description>
         <guid isPermaLink="false">http://www.leeholmes.com/blog/PermaLink,guid,8fd96bcb-e391-4389-829b-71f9f67f863d.aspx</guid>
         <pubDate>Fri, 20 Nov 2009 11:42:09 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Fixing Search Results: PowerShell 2.0 is RTM</title>
         <link>http://feedproxy.google.com/~r/HuddledMasses/~3/exRmbjs0vCw/</link>
         <description>For some reason, people are having trouble finding links to the release version of Windows PowerShell 2.0 &amp;#8230; I suspect it&amp;#8217;s because while it was in CTP, a lot of us bloggers wrote about it and linked to the various CTP downloads &amp;#8230; but there aren&amp;#8217;t nearly as many posts announcing the release of Windows [...]</description>
         <author>Joel 'Jaykul' Bennett</author>
         <guid isPermaLink="false">http://huddledmasses.org/?p=1323</guid>
         <pubDate>Fri, 20 Nov 2009 11:08:23 -0800</pubDate>
         <content:encoded><![CDATA[<p>For some reason, people are having trouble finding links to the release version of <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">Windows PowerShell 2.0</a> &#8230; I suspect it&#8217;s because while it was in CTP , a lot of us bloggers wrote about it and linked to the various <span class="caps">CTP</span> downloads &#8230; but there aren&#8217;t nearly as many posts announcing the release of <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">Windows PowerShell 2.0</a> as you would expect.</p> <p>Of course, most of the fault is Microsoft&#8217;s, because they buried <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">PowerShell 2</a> in a knowledge base article with a title that exceeds nondescript, even for Microsoft: <em>Description of the Windows Management Framework on Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008</em>. <strong>What?</strong> Even the <a rel="nofollow" target="_blank" href="http://blogs.msdn.com/powershell">Microsoft PowerShell Team Blog</a> never actually wrote a post announcing the <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">PowerShell 2.0 release is available for download</a> but instead wrote about the <a rel="nofollow" target="_blank" href="http://blogs.msdn.com/powershell/archive/2009/10/27/windows-management-framework-is-here.aspx">Windows Management Framework</a> being released.</p> <p>But in any case, I&#8217;m calling on the blogging community to fix the search engines by linking <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">Windows PowerShell</a> and particularly &#8220;Windows PowerShell 2.0&#8221;: http://support.microsoft.com/kb/968929 to either the <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">Knowledge base article 968929</a> which has the <a rel="nofollow" target="_blank" href="http://support.microsoft.com/kb/968929">download links for PowerShell 2.0</a> for Windows XP, Vista, and Server 2003 and 2008 &#8230; or to <a rel="nofollow" target="_blank" href="http://Microsoft.com/PowerShell">Microsoft.com/PowerShell</a> which has the latest download links in the side-column on the right hand side. <img src='http://huddledmasses.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'/> </p> <p>I can&#8217;t fix the search engines on my own, but what was that slogan? Together we can!</p><div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=exRmbjs0vCw:ik1BwBBhbbY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=exRmbjs0vCw:ik1BwBBhbbY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?i=exRmbjs0vCw:ik1BwBBhbbY:F7zBnMyn0Lo" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=exRmbjs0vCw:ik1BwBBhbbY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?i=exRmbjs0vCw:ik1BwBBhbbY:D7DqB2pKExk" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/HuddledMasses/~4/exRmbjs0vCw" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
         <category>Huddled</category>
      </item>
      <item>
         <title>Systems Management with NetPoint and PowerGUI</title>
         <link>http://dmitrysotnikov.wordpress.com/2009/11/20/systems-management-with-netpoint-and-powergui/</link>
         <description>Need a simple and affordable way to manage your Windows systems in batch? Shannon Ma from NetPoint has just posted a free PowerPack which integrates with NetPoint PowerShell interfaces and lets you easily inventory your network.
The PowerPack can work with both free and commercial version of NetPoint (guess, which one gives you more functionality [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&amp;blog=867377&amp;post=1636&amp;subd=dmitrysotnikov&amp;ref=&amp;feed=1&quot;/&gt;</description>
         <author>Dmitry Sotnikov</author>
         <guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1636</guid>
         <pubDate>Fri, 20 Nov 2009 10:53:09 -0800</pubDate>
         <content:encoded><![CDATA[<div class='snap_preview'><br /><p>Need a simple and affordable way to manage your Windows systems in batch? Shannon Ma from <a rel="nofollow" target="_blank" href="http://www.neutex.net/">NetPoint</a> has just posted a <a rel="nofollow" target="_blank" href="http://powergui.org/entry.jspa?externalID=2582&amp;categoryID=296">free PowerPack which integrates with NetPoint PowerShell interfaces</a> and lets you easily inventory your network.</p>
<p>The PowerPack can work with both free and commercial version of NetPoint (guess, which one gives you more functionality <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley'/> ) and provides a great way to collect various information from computers on your network, as well as install/unistall software, do restarts, run commands, and so on &#8211; all in all about 30 various tasks:</p>
<p><a rel="nofollow" target="_blank" href="http://dmitrysotnikov.files.wordpress.com/2009/11/netpointpowerpack.jpg"><img src="http://dmitrysotnikov.files.wordpress.com/2009/11/netpointpowerpack.jpg?w=300&#038;h=212" alt="" title="NetPointPowerPack" width="300" height="212" class="aligncenter size-medium wp-image-1638"/></a></p>
<p>Read more, leave your feedback and download the PowerPack <a rel="nofollow" target="_blank" href="http://powergui.org/entry.jspa?externalID=2582&amp;categoryID=296">here</a>.</p> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1636/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1636/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1636/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1636/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1636/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1636&subd=dmitrysotnikov&ref=&feed=1"/></div>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Quick Outlook Automation Examples</title>
         <link>http://halr9000.com/article/836</link>
         <description>PowerShell is so cool…
I had no idea how to automate Outlook with COM before today. Took me about 5 minutes to learn how with PowerShell. I knew it could be done with VBS, right? That’s how viruses are made. This won’t be a long blog unfortunately, but wanted to paste real quick a series [...]</description>
         <author>halr9000</author>
         <guid isPermaLink="false">http://halr9000.com/article/836</guid>
         <pubDate>Fri, 20 Nov 2009 06:15:29 -0800</pubDate>
         <content:encoded><![CDATA[<a rel="nofollow" target="_blank" href="http://halr9000.com/article/category/programming/scripting/powershell" title="Powershell"><img align="right" width="70" height="53" alt="Powershell"/></a>
<a rel="nofollow" target="_blank" href="http://halr9000.com/article/category/software/windows" title="Windows"><img align="right" width="54" height="46" alt="Windows"/></a>
<p>PowerShell is so cool…</p>
<p>I had no idea how to automate Outlook with COM before today. Took me about 5 minutes to learn how with PowerShell. I knew it could be done with VBS, right? That’s how viruses are made. <img src='http://halr9000.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'/> </p>
<p>This won’t be a long blog unfortunately, but wanted to paste real quick a series of commands which I basically figured out in a shell interactively. I didn’t have to read any docs, Get-Member told me all I needed to know.</p>
<p>I did go back and add some comments. I hope you find it useful.</p>
<div id="codeSnippetWrapper" style="border-right:silver 1px solid;padding-right:4px;border-top:silver 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:silver 1px solid;width:97.5%;cursor:text;direction:ltr;line-height:12pt;padding-top:4px;border-bottom:silver 1px solid;background-color:#f4f4f4;text-align:left;max-height:200px;">
<div id="codeSnippet" style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$ol = New-Object -com Outlook.Application <span style="color:#008000;"># starts outlook</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$ol.Reminders | select caption, nextreminderdate <span style="color:#008000;"># show reminders</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$ol | gm -mem method <span style="color:#008000;"># show all methods (actions) on the com object</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$n = $ol.CreateItem(<span style="color:#006080;">'olNoteItem'</span>) <span style="color:#008000;"># creates a note</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$n <span style="color:#008000;"># display note object</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$n.Body = <span style="color:#006080;">'test'</span> <span style="color:#008000;"># set body of note</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$n | gm <span style="color:#008000;"># display object members (methods &amp; properties) of note</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$n.Display() <span style="color:#008000;"># show note</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$n.Color <span style="color:#008000;"># display color value</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$n.Color = 4 <span style="color:#008000;"># set color</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">1..5 | ForEach-Object { $n.Color = $_; sleep 1 } <span style="color:#008000;"># change color of note 5 times</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$m = $ol.CreateItem(<span style="color:#006080;">'olMailItem'</span>) <span style="color:#008000;"># create mail object</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$m <span style="color:#008000;"># display mail object</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$m | gm -mem property <span style="color:#008000;"># show mail properties</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$m.Subject = <span style="color:#006080;">'test'</span> <span style="color:#008000;"># set subject</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$m.Body = <span style="color:#006080;">'test'</span> <span style="color:#008000;"># set body</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$m.To = <span style="color:#006080;">'email@domain.com'</span> <span style="color:#008000;"># set to address</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$m.Display() <span style="color:#008000;"># display mail item on screen </span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$m.Send() <span style="color:#008000;"># send mail item</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;">$ol <span style="color:#008000;"># display outlook object</span></pre>
<p></p>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;">$ol | gm # display outlook methods</pre>
<p></div>
</div>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (11/20/09)</title>
         <link>http://blogs.technet.com/heyscriptingguy/archive/2009/11/20/hey-scripting-guy-quick-hits-friday-the-scripting-guys-respond-to-a-bunch-of-questions-11-20-09.aspx</link>
         <description>In this post : Troubleshooting a Windows PowerShell Script Using the Replace Operator How Can I Get a List of Certificates and Their Expiration Dates? Can I Change a Registry Value on 200 Computers? Can I Use Windows PowerShell to Delete Folders Within...(&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/heyscriptingguy/archive/2009/11/20/hey-scripting-guy-quick-hits-friday-the-scripting-guys-respond-to-a-bunch-of-questions-11-20-09.aspx&quot;&gt;read more&lt;/a&gt;)&lt;img src=&quot;http://blogs.technet.com/aggbug.aspx?PostID=3292201&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>ScriptingGuy</author>
         <guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3292201</guid>
         <pubDate>Fri, 20 Nov 2009 00:01:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>PowerCLI 4.0 U1 is out!</title>
         <link>http://blogs.vmware.com/vipowershell/2009/11/powercli-40-u1-is-out.html</link>
         <description>Tonight we released PowerCLI 4.0 U1. This release contains more than 60 new cmdlets as well as greatly improved performance, a new feature to make it easy to manage multiple ESX or vCenter servers from a single window and much,...</description>
         <author>Carter Shanklin</author>
         <guid isPermaLink="false">http://blogs.vmware.com/vipowershell/2009/11/powercli-40-u1-is-out.html</guid>
         <pubDate>Thu, 19 Nov 2009 22:18:32 -0800</pubDate>
         <content:encoded><![CDATA[<p>Tonight we released <a rel="nofollow" target="_blank" href="http://downloads.vmware.com/downloads/download.do?downloadGroup=SDKWIN40U1">PowerCLI 4.0 U1</a>. This release contains more than 60 new cmdlets as well as greatly improved performance, a new feature to make it easy to manage multiple ESX or vCenter servers from a single window and <a rel="nofollow" target="_blank" href="http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/windowstoolkit40U1-200911-releasenotes.html#whatsnew">much, much more</a>. We’ve also put our <a rel="nofollow" target="_blank" href="http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/index.html">cmdlet reference</a> online. Watch this space over the next few days for demo videos but in the meantime don’t forget to <a rel="nofollow" target="_blank" href="http://downloads.vmware.com/downloads/download.do?downloadGroup=SDKWIN40U1">download</a> and give it a try.</p>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>PDC09 is over</title>
         <link>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/OIe3m50mCwU/</link>
         <description>Thanks for a the great conference Microsoft. Showing that as a large company they can still innovate. Azure, Siliverlight 4, Office 2010, Dallas, AppFabric and much more.
I finally go to shake the hand of Jeffrey Snover, the man behind the vision of PowerShell. We got to chat for a few minutes before he was on [...]</description>
         <author>Doug Finke</author>
         <guid isPermaLink="false">http://dougfinke.com/blog/index.php/2009/11/19/pdc09-is-over/</guid>
         <pubDate>Thu, 19 Nov 2009 20:44:29 -0800</pubDate>
         <content:encoded><![CDATA[<p>Thanks for a the great conference Microsoft. Showing that as a large company they can still innovate. <a rel="nofollow" target="_blank" href="http://www.microsoft.com/windowsazure/">Azure</a>, <a rel="nofollow" target="_blank" href="http://silverlight.net/getstarted/silverlight-4-beta/">Siliverlight 4</a>, <a rel="nofollow" target="_blank" href="http://www.microsoft.com/office/2010/en/default.aspx">Office 2010</a>, <a rel="nofollow" target="_blank" href="http://www.microsoft.com/windowsazure/developers/dallas/">Dallas</a>, <a rel="nofollow" target="_blank" href="http://www.microsoft.com/windowsazure/developers/dotnetservices/">AppFabric</a> and much more.</p>
<p>I finally go to shake the hand of Jeffrey Snover, the man behind the vision of PowerShell. We got to chat for a few minutes before he was on the panel <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Sessions/FT52">Microsoft Perspectives on the Future of Programming</a>. Some great thinkers on the panel, <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Speakers/Butler-Lampson">Butler Lampson</a>, <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Speakers/Erik-Meijer">Erik Meijer</a>, <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Speakers/Don-Box">Don Box</a>, <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Speakers/Jeffrey-Snover">Jeffrey Snover</a>, <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Speakers/Herb-Sutter">Herb Sutter</a>, <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Speakers/Burton-Smith">Burton Smith</a>. Covered Parallel programming (we’ll still be figuring it out in the next 5-10 years), textual DSLs, modeling, importance of glue languages and more.</p>
<p>I’ll be doing some posts on SQL Modeling Services (aka Oslo). Just finished <a rel="nofollow" target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=29e4ead0-fd81-42ba-862b-f3589378466a&amp;displaylang=en">downloading the latest CTP</a> on my main box. It has a dependency on .NET 4, works in VS 2010, has more features and better integration with SQL and VS. Don’t forget to download Pinky’s <a rel="nofollow" target="_blank" href="http://tinyfinger.blogspot.com/2009/11/dynamicobject-over-m-values.html">DynamicObject Over M values</a>. It is a implementation of .NET 4.0 dynamic object over Node/Edge data model provides a read-only object-based view over M values.</p>
<p>Plus sat in on the PowerShell talks. <a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Sessions/SVR12">Layering GUIs over PowerShell</a>. Very cool and just the beginning. <a rel="nofollow" target="_blank" href="http://blogs.msdn.com/powershell/attachment/9925010.ashx">Download the demos here</a>. They give insight to how Microsoft Exchange re-worked there GUIs to sit on top of PowerShell. Restricted Runspaces for security, Runspace Pools to execute PowerShell asynchronously, Remoting, and the start of how to ‘record’ the PowerShell commands the user is clicking on in the GUI.</p>
<p>Lot’s to experiment, enjoy and engage with.</p>
<img src="http://feeds.feedburner.com/~r/DevelopmentInABlink/~4/OIe3m50mCwU" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Excel 2010 beta</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2634.entry</link>
         <description>&lt;p&gt; &lt;/p&gt; &lt;p&gt;The beta still allows those of us that aren’t in the USA to use the simple method of creating a new spreadsheet using PowerShell.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xl&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-comobject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;excel.application&quot;&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;$xl&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;visible&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xlbooks&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xl&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;workbooks&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Add&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Makes life easier.&lt;/p&gt; &lt;p&gt;In case you are wondering – if you don’t have your machine set to US English and you are using Excel 2007 or earlier you have to do this.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:756px;padding-right:5px;font-family:consolas, lucida console;height:138px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xl&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-comobject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;excel.application&quot;&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;$xl&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;visible&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xlbooks&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xl&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;workbooks&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$newci&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[System.Globalization.CultureInfo]&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;en-US&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xlbooks&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;PSBase&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;GetType&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;InvokeMember&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Add&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[Reflection.BindingFlags]&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;InvokeMethod&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$xlbooks&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$newci&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Excel+2010&quot;&gt;Excel 2010&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Excel+2007+and+earlier&quot;&gt;Excel 2007 and earlier&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2634</guid>
         <pubDate>Thu, 19 Nov 2009 19:08:26 -0800</pubDate>
         <media:content></media:content>
         <category>Powershell</category>
      </item>
      <item>
         <title>PowerShell v2 cmdlets</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2633.entry</link>
         <description>&lt;p&gt;Jonathan has started a series of posts at &lt;a rel=&quot;nofollow&quot; title=&quot;http://www.jonathanmedd.net/&quot; target=&quot;_blank&quot; href=&quot;http://www.jonathanmedd.net/&quot;&gt;http://www.jonathanmedd.net/&lt;/a&gt; on all of the new cmdlets in PowerShell v2. If you are just starting with v2, or want more information on whats new, this is a good place to start.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell+v2&quot;&gt;PowerShell v2&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/cmdlets&quot;&gt;cmdlets&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2633</guid>
         <pubDate>Thu, 19 Nov 2009 18:18:49 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>Windows PowerShell and the Windows Management Framework</title>
         <link>http://blogs.msdn.com/powershell/archive/2009/11/20/windows-powershell-and-the-windows-management-framework.aspx</link>
         <description>&lt;p&gt;There’s been a lot of great excitement that’s accompanied the release of PowerShell V2 and Windows Remote Management (WinRM) – also known as the Windows Management Framework. We’ve also heard the occasional question on whether it’s possible to install them independently.&lt;/p&gt; &lt;p&gt;When we’ve heard this concern, it is usually focused on security. To be clear, Windows Remote Management (WinRM) has been part of Windows since Vista and Server 2008. It does not listen to network connections by default, and must be explicitly activated. Both have advanced greatly during the release of Windows 7 – most notably by working together to support a rich PowerShell-based remoting experience.&lt;/p&gt; &lt;p&gt;The Windows Management Framework download (PowerShell + WinRM) simply updates the binaries on non-Win7 machines to bring them up to the same version already included in Windows 7 and Windows Server 2008 R2.&lt;/p&gt; &lt;p&gt;Investigating this concern further, it usually comes down to concern about increased network attack surface: automatically opening a network port to accept incoming connections. Installing the Windows Management Framework does not do this automatically. “Secure by Default” is the mantra of both our team, and Microsoft as a whole. Enabling PowerShell Remoting is an explicit step that must be run from an elevated prompt. The command fully informs you of the security implications when you do so:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;[C:&amp;#92;Windows&amp;#92;system32] &lt;br /&gt;PS:101 &amp;gt; Enable-PsRemoting&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;WinRM Quick Configuration&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Running command &quot;Set-WSManQuickConfig&quot; to enable this machine for remote management through WinRM service.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;This includes: &lt;br /&gt;&lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; 1. Starting or restarting (if already started) the WinRM service &lt;br /&gt;&lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; 2. Setting the WinRM service type to auto start &lt;br /&gt;&lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; 3. Creating a listener to accept requests on any IP address &lt;br /&gt;&lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; 4. Enabling firewall exception for WS-Management traffic (for http only).&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Do you want to continue? &lt;br /&gt;&lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;[Y] Yes&amp;#160; [A] Yes to All&amp;#160; [N] No&amp;#160; [L] No to All&amp;#160; [S] Suspend&amp;#160; [?] Help (default is &quot;Y&quot;):&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;While we (and Windows Security, and external security consultants that we hired for analysis and penetration testing) &lt;b&gt;also&lt;/b&gt; believe in the security of our remoting protocol and the attack surface that it exposes, we focused from the start on letting you make that decision independently.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;p&gt;Lee Holmes [MSFT] &lt;br /&gt;Windows PowerShell Development &lt;br /&gt;Microsoft Corporation&lt;/p&gt;&lt;img src=&quot;http://blogs.msdn.com/aggbug.aspx?PostID=9925909&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>PowerShellTeam</author>
         <guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925909</guid>
         <pubDate>Thu, 19 Nov 2009 16:43:16 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Find That Service</title>
         <link>http://jdhitsolutions.com/blog/2009/11/find-that-service/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
         <description>Once again, the fine forum members at ScriptingAnswers.com come through and help get my PowerShell idea engine revving. The latest post posed this basic question: “I need to query my servers and find all services using a specific service account.” The poster thought this would be a good opportunity to learn PowerShell and I wholeheartedly [...]&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?a=kGU2RhZBT24:ftG5bGr5rok:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?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/JeffsScriptingBlogAndMore?a=kGU2RhZBT24:ftG5bGr5rok:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/kGU2RhZBT24&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Jeffery Hicks</author>
         <guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=515</guid>
         <pubDate>Thu, 19 Nov 2009 09:43:38 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Hey, Scripting Guy! How Can I Quickly Check Stocks with Windows PowerShell?</title>
         <link>http://blogs.technet.com/heyscriptingguy/archive/2009/11/19/hey-scripting-guy-november-19-2009.aspx</link>
         <description>Hey, Scripting Guy! I have a customized MSN home page. I really like the new layout, but it is rather inefficient to open Internet Explorer, and wait for a few minutes just to check out the latest stock prices. What I need is a Windows PowerShell script...(&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/heyscriptingguy/archive/2009/11/19/hey-scripting-guy-november-19-2009.aspx&quot;&gt;read more&lt;/a&gt;)&lt;img src=&quot;http://blogs.technet.com/aggbug.aspx?PostID=3292200&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>ScriptingGuy</author>
         <guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3292200</guid>
         <pubDate>Thu, 19 Nov 2009 00:01:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>PowerShell – WMI presentation tonight</title>
         <link>http://tfl09.blogspot.com/2009/11/powershell-wmi-presentation-tonight.html</link>
         <description>&lt;p&gt;The things I agree to do…&lt;/p&gt; &lt;p&gt;A good MVP buddy of mine, &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://huddledmasses.org/&quot;&gt;Joel 'Jaykul' Bennett&lt;/a&gt; has asked me to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://upnypug.wordpress.com/2009/11/18/powershell-and-wmi-will-be-on-livemeeting-tonight/&quot;&gt;speak tonight to the Upstate New York PowerShell user group&lt;/a&gt;. The title of the talk is &lt;strong&gt;WMI and&amp;#160; PowerShell&lt;/strong&gt;. I’m aiming at the basics but will go into a bit of detail. Plus there’s demos. If you want to join into the Live Meeting, here’s the url: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://&amp;lt;br&amp;gt;&quot;&gt;&quot;&amp;gt;https://&lt;/a&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.livemeeting.com/cc/mvp/join?id=UPNYPUG&amp;amp;role=attend&quot;&gt;www.livemeeting.com/cc/mvp/join?id=UPNYPUG&amp;amp;role=attend&lt;/a&gt; &lt;/p&gt; &lt;p&gt;However, I’m not planning on starting till 11:30 PM (23:30) UK time – which is thankfully earlier for the audience in New York.&lt;/p&gt; &lt;p&gt;Hope to see you there…&lt;/p&gt; &lt;p&gt;[later]&lt;/p&gt; &lt;p&gt;Yes – I will post my slides and demos tomorrow…&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:bf025154-8b0b-4a3d-a838-f6edd70213c2&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/WMI&quot;&gt;WMI&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Live+Meeting&quot;&gt;Live Meeting&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5384857-2522279159797768136?l=tfl09.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Thomas</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5384857.post-2522279159797768136</guid>
         <pubDate>Wed, 18 Nov 2009 14:18:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Reminders</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2629.entry</link>
         <description>&lt;p&gt;If I am working on my home machine I don’t necessarily have Outlook or any other application that gives me calendaring capability open. There are times when I need a simple reminder to do something. For some reason I always seem to have PowerShell open so I thought of using the eventing system to give me a reminder. I could also do this via the task scheduler functions in the PowerShellPack (Windows 7 Resource kit) which I’ll look at another day.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:686px;padding-right:5px;font-family:consolas, lucida console;height:393px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;019&lt;br /&gt;020&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Set-Alarm&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:#00008b;&quot;&gt;param&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:#008080;&quot;&gt;[datetime]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$time&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$msg&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Alert Issued&quot;&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;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:#ff4500;&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Date&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:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$time&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-gt&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$now&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;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ts&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$time&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$now&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:#00008b;&quot;&gt;else&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:#00008b;&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Time has to be in future&quot;&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$timer&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-TypeName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;System.Timers.Timer&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;$timer&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Interval&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ts&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TotalMilliseconds&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;$timer&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AutoReset&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$timer&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Enabled&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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;br /&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;$global:act&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Start-Process powershell -ArgumentList &quot;&quot;-Sta -WindowStyle Hidden -File C:&amp;#92;Scripts&amp;#92;WPF&amp;#92;show-alert.ps1 &quot;&quot;&quot;&quot;$msg&quot;&quot;&quot;&quot; &quot;&quot; &quot;&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:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Register-ObjectEvent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-InputObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$timer&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-EventName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Elapsed&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;TimeAlert&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Action&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:#0000ff;&quot;&gt;Invoke-Expression&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Command&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$act&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;My function accepts a time and a message&lt;/p&gt; &lt;p&gt;Set-Alarm &quot;18:47&quot; &quot;Test1&quot;&lt;/p&gt; &lt;p&gt;It then gets the current time, compares the two times and assuming the alert is to be issued in the future creates a Timespan object be subtracting the times as shown.&lt;/p&gt; &lt;p&gt;We can then create .NET timer object and set the interval to the total number of milliseconds in our timespan. We only want it to fire once so we set autoReset to false and then enable the timer.&lt;/p&gt; &lt;p&gt;I then create a global variable containing the powershell start up commands. In this case I want it to start in Single Thread mode so I can use the WPF classes. I call a script when PowerShell starts and pass the script the message. Note the number of quotes around the $msg variable – this is to make sure the string passed to invoke-expression is correct. This is messy but needed.&lt;/p&gt; &lt;p&gt;The $act variable has to be global because the action scriptblock for Register-objectevent isn’t evaluated until the event fires. If $act is in the script scope it won’t be found and the event won’t fire correctly.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;param&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:#008080;&quot;&gt;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$msg&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Testing&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Alert&quot;&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:#006400;&quot;&gt;## load WPF assemblies&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Add-Type&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;–assemblyName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;PresentationFramework&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Add-Type&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;–assemblyName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;PresentationCore&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Add-Type&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;–assemblyName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;WindowsBase&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## create a window&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$window&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-TypeName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;System.Windows.Window&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$window&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$title&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$window&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$msg&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$window&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;FontSize&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;36&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$window&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SizeToContent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;WidthAndHeight&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## display window&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$window&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ShowDialog&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;The script loads the WPF assemblies I need and then creates a window and writes out the message thats been passed in.&lt;/p&gt; &lt;p&gt;This is a bit messy with having to create a global variable but I can’t think of a simpler way to access the variable in the scriptblock for Register-objectevent. The other issue is that I can only have a single event of this type defined because of the variable. I would need to create the variable with a random name and create another string of the Register-objectevent invocation.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell+v2&quot;&gt;PowerShell v2&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Events&quot;&gt;Events&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Timer&quot;&gt;Timer&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2629</guid>
         <pubDate>Wed, 18 Nov 2009 19:11:11 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>PDC09 SVR12 and SVR13 Session Demos</title>
         <link>http://blogs.msdn.com/powershell/archive/2009/11/19/pdc09-svr12-and-svr13-demos-session-demos.aspx</link>
         <description>&lt;p&gt;Attached are the demos from the PDC sessions SVR12 and SVR 13 today. Here are the steps you need to do before you can run them&lt;/p&gt;
&lt;p&gt;1. Unzip the files and run setup&amp;#92;setup.ps1. This will configure user accounts and initialize some files required&lt;/p&gt;
&lt;p&gt;2. Change computers.dat in service&amp;#92;roles&amp;#92;. Set it to the computers that you want to connect to&lt;/p&gt;
&lt;p&gt;3. Edit Impersonation&amp;#92;Get-DelegationCredential.ps1 under each folder - Inventory, Service and Employee (Please Note: This script is intended only for demo purposes and is not recommended to be copied for production&lt;/p&gt;
&lt;p&gt;4. Set the paths in app.xaml.cs in each of the visual studio projects - EasyGUI and RemoteUI&lt;/p&gt;
&lt;p&gt;Once the above are done then you are all set. Play around with them and have fun !!!&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Nana&lt;/p&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;Narayanan Lakshmanan [MSFT] &lt;br&gt;Developer&lt;br&gt;Visit the Windows PowerShell Team blog at:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/PowerShell&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#006bad&quot;&gt;http://blogs.msdn.com/PowerShell&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;br&gt;Visit the Windows PowerShell ScriptCenter at:&amp;nbsp; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#006bad&quot;&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://blogs.msdn.com/aggbug.aspx?PostID=9925010&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>PowerShellTeam</author>
         <guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925010</guid>
         <pubDate>Wed, 18 Nov 2009 18:08:00 -0800</pubDate>
         <media:content></media:content>
         <enclosure length="183621" url="http://blogs.msdn.com/powershell/attachment/9925010.ashx" type="application/x-zip-compressed"/>
      </item>
      <item>
         <title>Is IIS 7 Console Based on PowerShell?</title>
         <link>http://dmitrysotnikov.wordpress.com/2009/11/19/is-iis-7-console-based-on-powershell/</link>
         <description>Now it is. However, this is not the native management console coming with IIS, but a free PowerPack which Adam Murray posted here.
Not only you can see (and modify) the PowerShell code behind everything the tool is doing, you will enjoy just using the console and all the great features it has, including for example: Create, [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&amp;blog=867377&amp;post=1633&amp;subd=dmitrysotnikov&amp;ref=&amp;feed=1&quot;/&gt;</description>
         <author>Dmitry Sotnikov</author>
         <guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1633</guid>
         <pubDate>Wed, 18 Nov 2009 17:53:57 -0800</pubDate>
         <content:encoded><![CDATA[<div class='snap_preview'><br /><p>Now it is. However, this is not the native management console coming with IIS, but a free PowerPack which Adam Murray posted <a rel="nofollow" target="_blank" href="http://powergui.org/entry.jspa?externalID=2581&amp;categoryID=296">here</a>.</p>
<p>Not only you can see (and modify) the PowerShell code behind everything the tool is doing, you will enjoy just using the console and all the great features it has, including for example:</p>
<ul>
<li>Create, rename, copy and delete application pools</li>
<li>Configure all app pool properties</li>
<li>Create, rename, copy and delete web sites</li>
<li>Create, rename, copy and delete ftp sites</li>
<li>Set various site properties</li>
<li>View and manage worker processes</li>
<li>View and manage IIS services</li>
<li>Manage site bindings</li>
<li>Creates the various enum types from the IIS schema to allow the use of dropdowns for configuring properties</li>
</ul>
<p><a rel="nofollow" target="_blank" href="http://dmitrysotnikov.files.wordpress.com/2009/11/iispowerpack3.jpg"><img class="aligncenter size-medium wp-image-1634" title="IISPowerpack3.JPG" src="http://dmitrysotnikov.files.wordpress.com/2009/11/iispowerpack3.jpg?w=300&#038;h=180" alt="" width="300" height="180"/></a></p>
<p>To learn about all its features, see screenshots and download the actual tool go to the <a rel="nofollow" target="_blank" href="http://powergui.org/entry.jspa?externalID=2581&amp;categoryID=296">IIS 7 powerpack page</a>.</p>
<p>And don&#8217;t forget about other great PowerPacks Adam have created in the past for <a rel="nofollow" title="Permanent Link to "WebSphere MQ&#xa0;PowerPack"" target="_blank" href="http://dmitrysotnikov.wordpress.com/2008/10/01/websphere-mq-powerpack/">WebSphere MQ</a> and <a rel="nofollow" target="_blank" href="http://dmitrysotnikov.wordpress.com/2008/08/20/sql-reporting-services-powerpack/">SQL Reporting Services PowerPack</a>.</p> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1633/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1633/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1633/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1633/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1633/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1633&subd=dmitrysotnikov&ref=&feed=1"/></div>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>PrimalForms 2009: New Packager STA Mode</title>
         <link>http://feedproxy.google.com/~r/SapienBlog/~3/nMGLcZOBp4A/</link>
         <description>Last month’s service build included a new addition to PrimalForms 2009’s packager: STA Mode (Single Thread Apartment), which allows you to perform operations that may have previously failed, such as accessing Window’s Clipboard.
Some of you may have attempted to use the Clipboard in your forms only to encounter issues within PowerShell.
For example, if you try [...]</description>
         <author>David Corrales</author>
         <guid isPermaLink="false">http://blog.sapien.com/index.php/2009/11/18/primalforms-2009-new-packager-sta-mode/</guid>
         <pubDate>Wed, 18 Nov 2009 15:33:54 -0800</pubDate>
         <content:encoded><![CDATA[<p>Last month’s service build included a new addition to PrimalForms 2009’s packager: STA Mode (Single Thread Apartment), which allows you to perform operations that may have previously failed, such as accessing Window’s Clipboard.</p>
<p>Some of you may have attempted to use the Clipboard in your forms only to encounter issues within PowerShell.</p>
<p>For example, if you try to copy data from a DataGrid you will get the following error:</p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/CopyFromGrid.png"><img title="Copy From Grid" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="102" alt="Copy From Grid" src="http://blog.sapien.com/wp-content/uploads/2009/11/CopyFromGrid_thumb.png" width="244" border="0"/></a> </p>
<p>This issue also comes up if you try to access the Clipboard directly from within Powershell:</p>
<p>[System.Windows.Forms.Clipboard]::SetText("Paste this text to the clipboard")</p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/ClipboardError.png"><img title="Clipboard Error" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="67" alt="Clipboard Error" src="http://blog.sapien.com/wp-content/uploads/2009/11/ClipboardError_thumb.png" width="244" border="0"/></a> </p>
<p>These issues arise because PowerShell runs in a MTA mode (Multi-Thread Apartment), yet the clipboard operations require the process to be in STA mode (Single Thread Apartment). A full explanation of Thread Apartments goes beyond the purpose of this blog, so we will provide a very condensed explanation: Thread Apartments boil down to how a process manages legacy COM objects and their communications between multiple threads. </p>
<p>The new PrimalForms 2009 Packager’s STA Mode allows you to package scripts that can access STA dependent operations, such as the Clipboard. To create STA packages, you simply check the “Run In STA Mode” options in the General Packager Settings page and press the Build button.</p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/PackagerSettings.png"><img title="Packager Settings" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="159" alt="Packager Settings" src="http://blog.sapien.com/wp-content/uploads/2009/11/PackagerSettings_thumb.png" width="244" border="0"/></a> </p>
<p>Now your packaged scripts can access the clipboard without encountering the issues mentioned above. </p>
<p>Please note that STA Mode is only compatible with WIN32 Windows and WIN64 Windows packager settings. </p> <span class="slashdigglicious">
<a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F&amp;title=PrimalForms+2009%3A+New+Packager+STA+Mode" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]"/></a>
<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F&amp;title=PrimalForms+2009%3A+New+Packager+STA+Mode" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]"/></a>
<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F&amp;title=PrimalForms+2009%3A+New+Packager+STA+Mode" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]"/></a>
<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F&amp;title=PrimalForms+2009%3A+New+Packager+STA+Mode" title="Save to del.icio.us"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]"/></a>
<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]"/></a>
<a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]"/></a>
<a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F&amp;title=PrimalForms+2009%3A+New+Packager+STA+Mode" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]"/></a>
<a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F18%2Fprimalforms-2009-new-packager-sta-mode%2F&amp;title=PrimalForms+2009%3A+New+Packager+STA+Mode" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]"/></a>
</span>
 <p class='technorati-tags'>Technorati Tags: <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/Clipboard'>Clipboard</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/forms'>forms</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/powershell'>powershell</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/PrimalForms'>PrimalForms</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/STA'>STA</a></p> 
<div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=nMGLcZOBp4A:lzz12TmlISM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=nMGLcZOBp4A:lzz12TmlISM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=I9og5sOYxJI" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=nMGLcZOBp4A:lzz12TmlISM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=7Q72WNTAKBA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=nMGLcZOBp4A:lzz12TmlISM:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=nQ_hWtDbxek" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/SapienBlog/~4/nMGLcZOBp4A" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>3 Screens and The Cloud – PDC09</title>
         <link>http://feedproxy.google.com/~r/DevelopmentInABlink/~3/6PxIbjK25Cg/</link>
         <description>Microsoft’s story feels pretty sound. Desktop, Laptop/Netbook, Mobile and the cloud.&amp;#160; Direct Links App Fabric Download&amp;#160;&amp;#160; Windows Azure platform AppFabric provides common building blocks required by .NET applications when extending their functionality to the cloud, and specifically, the Windows Azure platform. Microsoft Dallas Use the Dallas Service Explorer to visually construct REST API queries and preview [...]</description>
         <author>Doug Finke</author>
         <guid isPermaLink="false">http://dougfinke.com/blog/index.php/2009/11/18/3-screens-and-the-cloud-pdc09/</guid>
         <pubDate>Wed, 18 Nov 2009 09:09:10 -0800</pubDate>
         <content:encoded><![CDATA[<p>Microsoft’s story feels pretty sound. Desktop, Laptop/Netbook, Mobile and the cloud.&#160; </p>
<h3>Direct Links</h3>
<ul>
<li><a rel="nofollow" target="_blank" href="http://www.microsoft.com/windowsazure/developers/dotnetservices/">App Fabric Download</a>&#160;&#160; Windows Azure platform AppFabric provides common building blocks required by .NET applications when extending their functionality to the cloud, and specifically, the Windows Azure platform. </li>
<li><a rel="nofollow" target="_blank" href="http://www.microsoft.com/windowsazure/developers/dallas/">Microsoft Dallas</a> Use the Dallas Service Explorer to visually construct REST API queries and preview the content in XML, ATOM, RAW (for blob and real-time content), or in Table view and you can use <a rel="nofollow" target="_blank" href="http://www.powerpivot.com/">Power Pivot</a> with the data. </li>
<li><a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx">Reactive Extensions for .NET</a>
<ul>
<li>Check out <a rel="nofollow" target="_blank" href="http://codebetter.com/blogs/matthew.podwysocki/archive/2009/10/14/introducing-the-reactive-framework-part-i.aspx">Matt’s multi part series</a>. Including a Twitter client </li>
<li><a rel="nofollow" target="_blank" href="http://blogs.msdn.com/somasegar/archive/2009/11/18/reactive-extensions-for-net-rx.aspx">Reactive Extensions for .NET (Rx)</a></li>
</ul>
</li>
<li>
<h4>SQL Server Modeling </h4>
<p> Renamed from Oslo. Modeling has a home in a shipping Microsoft product. It was also shown during the first keynote and how it can play in Cloud development.
<ul>
<li><a rel="nofollow" target="_blank" href="http://blogs.msdn.com/modelcitizen/archive/2009/11/17/announcing-the-sql-server-modeling-n-e-oslo-ctp-for-november-2009.aspx">Check out the write up</a> </li>
<li><a rel="nofollow" target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=29e4ead0-fd81-42ba-862b-f3589378466a&amp;displaylang=en">Download the CTP</a> </li>
<li>Read <a rel="nofollow" target="_blank" href="http://www.douglaspurdy.com/2009/11/10/from-oslo-to-sql-server-modeling/">Doug Purdy’s blog</a> (owner of Modeling) and <a rel="nofollow" target="_blank" href="http://www.douglaspurdy.com/2009/11/12/on-dsls-and-a-few-other-things/">On DSLs and a few other things</a> </li>
</ul>
</li>
<li>PowerShell. “Demoed” quickly during the keynote for deploying to the Azure Cloud. PowerShell is the automation platform for Windows. </li>
<li><a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx">Visual studio 2010</a> has a huge number of features for developers. Intellitrace, Architecture Explorer, Azure templates, Parallel debugging and more </li>
</ul>
<img src="http://feeds.feedburner.com/~r/DevelopmentInABlink/~4/6PxIbjK25Cg" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>PowerShell UG Australia – What’s been happening?</title>
         <link>http://feedproxy.google.com/~r/LeadFollowMove/~3/5Q2aAh9JTkI/powershell-ug-australia-whats-been-happening</link>
         <description>The UG is coming up to it&amp;#8217;s 3rd meeting on the 26th of this month. The first meeting, in September, was a presentation style meeting, where two presentations were given to the audience in Perth. Courtesy of Microsoft Australia, Live Meeting was available to provide an online capability which was manned by Jeff Alexander. The [...]</description>
         <author>Adam Bell</author>
         <guid isPermaLink="false">http://www.leadfollowmove.com/?p=435</guid>
         <pubDate>Wed, 18 Nov 2009 04:50:12 -0800</pubDate>
         <content:encoded><![CDATA[<p>The UG is coming up to it&#8217;s 3rd meeting on the 26th of this month. </p>
<p>The first meeting, in September, was a presentation style meeting, where two presentations were given to the audience in Perth. Courtesy of Microsoft Australia, Live Meeting was available to provide an online capability which was manned by Jeff Alexander. The attendance was modest, but as the only advertising was through this site and Twitter, that was to be expected. This was also to give me the chance to practice presenting to a room and handling the Live Meeting interface as well.</p>
<p>In an effort to reduce the strain on trying to get presenters and material together every month, we are trialing alternating the presentation style sessions with &#8220;script clubs&#8221;. The idea behind this is that the presentation sessions will follow the format that was used with the UK PowerShell Group (Get-PSUGUK) of 3x 20 minute sessions with a beer and pizza break to encourage the socialising side of the group. For these sessions we&#8217;re hoping to provide access to Live Meeting and make the recordings available on the <a rel="nofollow" target="_blank" href="http://www.psugau.org">UG website</a> afterwards for download.</p>
<p>The script club is new to me, but is becoming popular with a lot of the PowerShell UG&#8217;s everywhere. The idea here is to turn up with your laptop and in a relaxed social environment get some hands on PowerShell scripting. Whether, this is best handled by setting small &#8220;challenges&#8221; to the group to encourage working out how to achieve this through PowerShell, or whether members of the group bring ideas, or problems with them that as a group we work out is yet to be seen, but I&#8217;m happy to look at both approaches. I&#8217;ll put a poll up and we&#8217;ll see what the interest is like.</p>
<p>I attended the <a rel="nofollow" target="_blank" href="http://perthdotnet.org/Default.aspx">.Net Community of Practice</a> a couple of weeks ago to meet members of the Perth UG community and to spread the word of the PowerShell UG across a social beer afterwards. The intention isn&#8217;t to steal any members, but to raise awareness and get the word of mouth advertising amongst the Perth IT geeks. It was a great bunch of guys and <a rel="nofollow" target="_blank" href="http://mitch-wheat.blogspot.com/">Mitch</a> had one of their biggest turn out&#8217;s of 63!</p>
<p>Last week, <a rel="nofollow" target="_blank" href="http://wolfbyte-net.blogspot.com/">Mike</a> invited me to present a small session with the <a rel="nofollow" target="_blank" href="http://perth.ozalt.net/2009/11/all-in.html">Perth ALT.Net UG</a>. This was a much less formal approach and I really enjoyed hanging out and talking to these guys about PowerShell. Talking to Developers provided a totally new approach to me as I expected them to have a great understand of the .Net classess and namespaces so with the help of Mike, showing some of the basic tasks that PowerShell can do was fun and the questions were interesting.</p>
<p>On the East coast, <a rel="nofollow" target="_blank" href="http://www.get-powershell.info/psugau">Shane Hoey</a> has been running script clubs at Microsoft Brisbane. Details for the PowerShell UG are on the web site, and using the <strong>#PSUGAU</strong> hash tag in twitter.</p>
<p>The thing I have found the most interesting from my two visits is that the User Group community in Perth is vibrant, and there&#8217;s a lot of cool geeks to hang out and chat with. Over the next few months I&#8217;m hoping to attend more as my schedule permits and keep evangelising PowerShell. I&#8217;m still amazed how little IT pro&#8217;s seem to grasp what it&#8217;s capable of!</p>
<p>So, if you&#8217;re looking to get involved in your community, and want to find a User Group, check out the list of <a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-au/cc185136.aspx">Microsoft Australian User groups</a>, but be warned this link only plays nicely in IE.</p>]]></content:encoded>
         <media:content></media:content>
         <category>PowerShell</category>
      </item>
      <item>
         <title>WMI CookBook: WMI Presentation</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2625.entry</link>
         <description>&lt;p&gt;As with other PowerShell objects there is a default format for the display of WMI objetcs. If we look at the NetworkAdapter class&lt;/p&gt; &lt;p&gt;PS&amp;gt; Get-WmiObject -Class Win32_NetworkAdapter -Filter &quot;DeviceId='11'&quot; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;ServiceName : athr&lt;br /&gt;MACAddress : 00:00:00:00:00:00&lt;br /&gt;AdapterType : Ethernet 802.3&lt;br /&gt;DeviceID : 11&lt;br /&gt;Name : Atheros AR5007 802.11b/g WiFi Adapter&lt;br /&gt;NetworkAddresses :&lt;br /&gt;Speed : 54000000&lt;/font&gt; &lt;p&gt;You didn’t think I’d really give you my MAC address did you?&lt;/p&gt; &lt;p&gt;If we want to see all of the properties we can do this&lt;/p&gt; &lt;p&gt;Get-WmiObject -Class Win32_NetworkAdapter -Filter &quot;DeviceId='11'&quot; | select -Property * &lt;/p&gt; &lt;p&gt;but we get a few ugly looking entries&lt;/p&gt; &lt;p&gt;__GENUS&lt;br /&gt;__CLASS&lt;br /&gt;__SUPERCLASS&lt;br /&gt;__DYNASTY&lt;br /&gt;__RELPATH&lt;br /&gt;__PROPERTY_COUNT&lt;br /&gt;__DERIVATION&lt;br /&gt;__SERVER&lt;br /&gt;__NAMESPACE&lt;br /&gt;__PATH &lt;p&gt;that we may not actually want or need.&lt;/p&gt; &lt;p&gt;We can easily filter them out if desired&lt;/p&gt; &lt;p&gt;Get-WmiObject -Class Win32_NetworkAdapter -Filter &quot;DeviceId='11'&quot; | select -Property * -ExcludeProperty &quot;__*&quot;&lt;/p&gt; &lt;p&gt;The ExcludeProperty takes a wild card to identify the properties with two underscore characters at the front.&lt;/p&gt; &lt;p&gt;Simple but effective.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/WMI&quot;&gt;WMI&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Property+Selection&quot;&gt;Property Selection&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2625</guid>
         <pubDate>Tue, 17 Nov 2009 19:12:03 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell and WMI</category>
      </item>
      <item>
         <title>Office 2010 beta</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2624.entry</link>
         <description>&lt;p&gt;The Office 2010 beta is available on TechNet and MSDN. The installation seems very smooth. Need to uninstall Technical Preview version first – thats always boring and a pain.&lt;/p&gt; &lt;p&gt;Slight hiccup over activation as the license key wasn’t asked for by Office when doing a customised install!! Soon resolved that. Visio and Project have separate installs but the look and feel matches the rest of Office.&lt;/p&gt; &lt;p&gt;Now I’ve got that I’ll try a few more PowerShell and Office projects. Be good to dig out the One Note PowerShell functions as well.&lt;/p&gt; &lt;p&gt;I remembered to export my autocorrect entries before uninstalling the previous version and managed to import them back in – functions to do this can be found in earlier posts.&lt;/p&gt; &lt;p&gt;I’m expecting this to be boring &amp;amp; just work. I’ll let you know how I get on.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Office+2010&quot;&gt;Office 2010&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/beta&quot;&gt;beta&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/install&quot;&gt;install&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2624</guid>
         <pubDate>Tue, 17 Nov 2009 18:04:19 -0800</pubDate>
         <media:content></media:content>
         <category>Microsoft</category>
      </item>
      <item>
         <title>&amp;ldquo;Project Onyx&amp;rdquo; is here.</title>
         <link>http://blogs.vmware.com/vipowershell/2009/11/project-onyx-is-here.html</link>
         <description>A few months ago we announced a very exciting new application we call “Project Onyx”. To put it simply, Project Onyx is a script recorder for vSphere Client. Since then my inbox has been flooded with requests from all over...</description>
         <author>Carter Shanklin</author>
         <guid isPermaLink="false">http://blogs.vmware.com/vipowershell/2009/11/project-onyx-is-here.html</guid>
         <pubDate>Mon, 16 Nov 2009 21:14:12 -0800</pubDate>
         <content:encoded><![CDATA[<p>A few months ago we <a rel="nofollow" target="_blank" href="http://blogs.vmware.com/vipowershell/2009/08/what-is-onyx-visit-us-at-vmworld-and-get-a-chance-to-find-out.html">announced</a> a very exciting new application we call “Project Onyx”. To put it simply, Project Onyx is a script recorder for vSphere Client. Since then my inbox has been flooded with requests from all over the world from people wanting to try Onyx. At long last we’ve released our first public alpha.</p> <p>Here’s a video that shows a quick demo of using the alpha build. You can also go straight to the <a rel="nofollow" target="_blank" href="http://tinyurl.com/ygayony">download</a>.</p> <iframe class="embeddedvideo" src="http://www.youtube.com/v/bANfdjuH4wk&amp;hl=en_US&amp;fs=1&amp;hd=1" type="application/x-shockwave-flash" width="640" height="505"></iframe> <p>&#160;</p> <p>There are two things to note when you’re using Onyx. First, the code Onyx generates makes heavy use of direct API calls rather than PowerCLI cmdlets. So even if you use Onyx to power on a VM, instead of using the Start-VM cmdlet it will use the API’s PoweronMultiVM_Task. To put it another way Onyx is best for automating things that can’t be automated using native PowerCLI cmdlets.</p> <p>Second, you will need to edit scripts that Onyx produces in order to turn them into reusable code. The code Onyx produces today includes a lot of parameters that are very specific to the object you select and have to be refactored or removed. I’ll expand on this subject in later posts. Still Onyx makes it a lot easier than poring through API documentation.</p>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>WMI CookBook: Associators Pt I</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2620.entry</link>
         <description>&lt;p&gt;WMI is a wonderful thing and like many people I have a love-hate relationship with it. It is incredibly powerful, and can take you deep into the system, but it is not easy to find your way.&lt;/p&gt; &lt;p&gt;I have decided to spend some time digging into WMI and will document the findings in a (long) series of blog posts. I also intend to pull the information together into a document that will be available for download. The scripts will end up in PowerShell modules that will also be available for download.&lt;/p&gt; &lt;p&gt;I am doing this with PowerShell v2 on Windows 7. Where necessary, and wherever possible, I will give alternatives that can be used with PowerShell v1.&lt;/p&gt; &lt;p&gt;The main trick with WMI is finding out the class or classes we need to actually use. The standard PowerShell way of searching for classes is to use the –List parameter. Network Adapters are common items we need to deal with so we’ll see what WMI can tell us. First, what WMI classes deal with Network Adapters. One thing we can do with –List is give a partial class name and a wildcard to restrict the results (otherwise we get lots, and lots of classes returned). To begin with I’m only interested in the name of the class. I’m working in the default name space so don’t need to mention it.&lt;/p&gt; &lt;p&gt;PS&amp;gt; Get-WmiObject -List &quot;Win32_NetworkAdapter*&quot; | Select Name&lt;/p&gt; &lt;p&gt;Name &lt;br /&gt;---- &lt;br /&gt;Win32_NetworkAdapter &lt;br /&gt;Win32_NetworkAdapterConfiguration &lt;br /&gt;Win32_NetworkAdapterSetting &lt;/p&gt; &lt;p&gt;We could now go off to MSDN and check what these classes do but we can find that information directly. As Jeffrey showed recently &lt;a rel=&quot;nofollow&quot; title=&quot;http://blogs.msdn.com/powershell/archive/2009/08/30/exploring-wmi-with-powershell-v2.aspx&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/powershell/archive/2009/08/30/exploring-wmi-with-powershell-v2.aspx&quot;&gt;http://blogs.msdn.com/powershell/archive/2009/08/30/exploring-wmi-with-powershell-v2.aspx&lt;/a&gt; we can use the –Amended parameter to show the description property.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:772px;padding-right:5px;font-family:consolas, lucida console;height:71px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001 &lt;br /&gt;002 &lt;br /&gt;003 &lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-WmiObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-List&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Win32_NetworkAdapter*&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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;(&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:#0000ff;&quot;&gt;Get-WmiObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-List&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Amended&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Qualifiers&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Where&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:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Description&quot;&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Value&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;This gives use this information for the three classes.&lt;/p&gt; &lt;p&gt;The Win32_NetworkAdapter class represents a network adapter on a Win32 system. &lt;br /&gt;The Win32_NetworkAdapterConfiguration class represents the attributes and behaviors of a network adapter. This class has been extended to include extra properties and methods that support the management of the TCP/IPprotocols (and are independent of the network adapter). &lt;br /&gt;The Win32_NetworkAdapterSetting class represents an association between a network adapter and its configuration settings. &lt;/p&gt; &lt;p&gt;If we look at Win32_NetworkAdapterSetting&lt;/p&gt; &lt;p&gt;Get-WmiObject Win32_NetworkAdapterSetting&lt;/p&gt; &lt;p&gt;we will see an entry for each adapter that links the adapter with its configuration. This information is paired like this:&lt;/p&gt; &lt;p&gt;Element : &amp;#92;&amp;#92;RSLAPTOP01&amp;#92;root&amp;#92;cimv2:Win32_NetworkAdapter.DeviceID=&quot;11&quot; &lt;br /&gt;Setting : &lt;a rel=&quot;nofollow&quot;&gt;&amp;#92;&amp;#92;RSLAPTOP01&amp;#92;root&amp;#92;cimv2:Win32_NetworkAdapterConfiguration.Index=11&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If we look at the adapter and its configuration &lt;/p&gt; &lt;p&gt;Get-WmiObject -Class Win32_NetworkAdapter -Filter &quot;DeviceID='11'&quot;&lt;/p&gt; &lt;p&gt;Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter &quot;Index='11'&quot;&lt;/p&gt; &lt;p&gt;we can see the individual information. Going through the Win32_NetworkAdapterSetting class is tedious but now we now that the adapter’s DeviceId is linked to the Configurations Index we can use this ASSOCIATION via a bit of WQL.&lt;/p&gt; &lt;p&gt;Get-WmiObject -Query &quot;ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='11'} WHERE ResultClass=Win32_NetworkAdapterConfiguration&quot; &lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;DHCPEnabled : True &lt;br /&gt;IPAddress : {192.168.196.138, fe80::6d95:b824:6a72:a0a9} &lt;br /&gt;DefaultIPGateway : {192.168.196.1} &lt;br /&gt;DNSDomain : &lt;br /&gt;ServiceName : athr &lt;br /&gt;Description : Atheros AR5007 802.11b/g WiFi Adapter &lt;br /&gt;Index : 11&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The other thing to think about is what other associations exist.&lt;/p&gt; &lt;p&gt;PS&amp;gt; Get-WmiObject -Query &quot;ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='11'} &quot; | Select __CLASS -Unique &lt;/p&gt; &lt;p&gt;__CLASS &lt;br /&gt;------- &lt;br /&gt;Win32_PnPEntity &lt;br /&gt;Win32_ComputerSystem &lt;br /&gt;Win32_NetworkAdapterConfiguration &lt;br /&gt;Win32_IRQResource &lt;br /&gt;Win32_DeviceMemoryAddress &lt;br /&gt;Win32_NetworkProtocol &lt;br /&gt;Win32_SystemDriver&lt;/p&gt; &lt;p&gt;So we have a set of classes that are all associated through the network adpater device id. In the next few posts we will dig into this web and see what we can discover and how we can use these associations to help us understand our system.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/WMI&quot;&gt;WMI&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Network&quot;&gt;Network&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2620</guid>
         <pubDate>Mon, 16 Nov 2009 21:04:32 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell and WMI</category>
      </item>
      <item>
         <title>WMI CookBook: Associators Pt I</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2619.entry</link>
         <description>&lt;p&gt;WMI is a wonderful thing and like many people I have a love-hate relationship with it. It is incredibly powerful, and can take you deep into the system, but it is not easy to find your way.&lt;/p&gt; &lt;p&gt;I have decided to spend some time digging into WMI and will document the findings in a (long) series of blog posts. I also intend to pull the information together into a document that will be available for download. The scripts will end up in PowerShell modules that will also be available for download.&lt;/p&gt; &lt;p&gt;I am doing this with PowerShell v2 on Windows 7. Wher necessary, and wherever possible, I will give alternatives that can be used with PowerShell v1.&lt;/p&gt; &lt;p&gt;The main trick with WMI is finding out the class or classes we need to actually use. The standard PowerShell way of searching for classes is to use the –List parameter. Network Adapters are common items we need to deal with so we’ll see what WMI can tell us. First, what WMI classes deal with Network Adapters. One thing we can do with –List is give a partial class name and a wildcard to restrict the results (otherwise we get lots, and lots of classes returned). To begin with I’m only interested in the name of the class. I’m working in the default name space so don’t need to mention it.&lt;/p&gt; &lt;p&gt;PS&amp;gt; Get-WmiObject -List &quot;Win32_NetworkAdapter*&quot; | Select Name&lt;/p&gt; &lt;p&gt;Name&lt;br /&gt;----&lt;br /&gt;Win32_NetworkAdapter&lt;br /&gt;Win32_NetworkAdapterConfiguration&lt;br /&gt;Win32_NetworkAdapterSetting &lt;p&gt; We could now go off to MSDN and check what these classes do but we can find that information directly. As Jeffrey showed recently &lt;a rel=&quot;nofollow&quot; title=&quot;http://blogs.msdn.com/powershell/archive/2009/08/30/exploring-wmi-with-powershell-v2.aspx&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/powershell/archive/2009/08/30/exploring-wmi-with-powershell-v2.aspx&quot;&gt;http://blogs.msdn.com/powershell/archive/2009/08/30/exploring-wmi-with-powershell-v2.aspx&lt;/a&gt; we can use the –Amended parameter to show the description property.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:772px;padding-right:5px;font-family:consolas, lucida console;height:71px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-WmiObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-List&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Win32_NetworkAdapter*&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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;(&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:#0000ff;&quot;&gt;Get-WmiObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-List&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Amended&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Qualifiers&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Where&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:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Description&quot;&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Value&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;This gives use this information for the three classes. &lt;p&gt;The Win32_NetworkAdapter class represents a network adapter on a Win32 system.&lt;br /&gt;The Win32_NetworkAdapterConfiguration class represents the attributes and behaviors of a network adapter. This class has been extended to include extra properties and methods that support the management of the TCP/IPprotocols (and are independent of the network adapter).&lt;br /&gt;The Win32_NetworkAdapterSetting class represents an association between a network adapter and its configuration settings. &lt;p&gt;If we look at Win32_NetworkAdapterSetting&lt;/p&gt; &lt;p&gt;Get-WmiObject Win32_NetworkAdapterSetting&lt;/p&gt; &lt;p&gt;we will see an entry for each adapter that links the adapter with its configuration. This information is paired like this:&lt;/p&gt; &lt;p&gt;Element : &amp;#92;&amp;#92;RSLAPTOP01&amp;#92;root&amp;#92;cimv2:Win32_NetworkAdapter.DeviceID=&quot;11&quot;&lt;br /&gt;Setting : &lt;a rel=&quot;nofollow&quot;&gt;&amp;#92;&amp;#92;RSLAPTOP01&amp;#92;root&amp;#92;cimv2:Win32_NetworkAdapterConfiguration.Index=11&lt;/a&gt; &lt;p&gt;If we look at the adapter and its configuration &lt;/p&gt; &lt;p&gt;Get-WmiObject -Class Win32_NetworkAdapter -Filter &quot;DeviceID='11'&quot;&lt;/p&gt; &lt;p&gt;Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter &quot;Index='11'&quot;&lt;/p&gt; &lt;p&gt;we can see the individual information. Going through the Win32_NetworkAdapterSetting class is tedious but now we now that the adapter’s DeviceId is linked to the Configurations Index we can use this ASSOCIATION via a bit of WQL.&lt;/p&gt; &lt;p&gt;Get-WmiObject -Query &quot;ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='11'} WHERE ResultClass=Win32_NetworkAdapterConfiguration&quot; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;DHCPEnabled : True&lt;br /&gt;IPAddress : {192.168.196.138, fe80::6d95:b824:6a72:a0a9}&lt;br /&gt;DefaultIPGateway : {192.168.196.1}&lt;br /&gt;DNSDomain :&lt;br /&gt;ServiceName : athr&lt;br /&gt;Description : Atheros AR5007 802.11b/g WiFi Adapter&lt;br /&gt;Index : 11&lt;/font&gt; &lt;p&gt;The other thing to think about is what other associations exist. &lt;p&gt;PS&amp;gt; Get-WmiObject -Query &quot;ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='11'} &quot; | Select __CLASS -Unique &lt;p&gt;__CLASS&lt;br /&gt;-------&lt;br /&gt;Win32_PnPEntity&lt;br /&gt;Win32_ComputerSystem&lt;br /&gt;Win32_NetworkAdapterConfiguration&lt;br /&gt;Win32_IRQResource&lt;br /&gt;Win32_DeviceMemoryAddress&lt;br /&gt;Win32_NetworkProtocol&lt;br /&gt;Win32_SystemDriver &lt;p&gt;So we have a set of classes that are all associated through the network adpater device id. In the next few posts we will dig into this web and see what we can discover and how we can use these associations to help us understand our system.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/WMI&quot;&gt;WMI&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Network&quot;&gt;Network&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2619</guid>
         <pubDate>Mon, 16 Nov 2009 21:02:54 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell and WMI</category>
      </item>
      <item>
         <title>Episode 92 - PowerScripting Podcast - The BSonPosh module with MVP Brandon Shell</title>
         <link>http://feedproxy.google.com/~r/Powerscripting/~3/4sds2S8-PTg/index.php</link>
         <description>Tonight we talk to Brandon Shell about virtualization, VDI, and his new BSonPoshPowerShell module.&lt;div id=&quot;yk4e&quot;&gt;
&lt;/div&gt;
&lt;h2&gt;&lt;span style=&quot;font-size:medium;&quot;&gt;News&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt; &lt;/span&gt;
&lt;div&gt;&lt;i&gt;Before you acquire power, you must acquire knowledge â and
Quest Software has what you need! In Jeffery Hicksâ e-book, âManaging
Active Directory with Windows PowerShell,â learn how PowerShell helps
you master local accounts and groups, password management, security and
permissions and much, much more. Youâll also learn about the PowerShell
extras and out-of-the-box features that will help you control Active
Directory. &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Donât wait â visit &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.quest.com/powershellbook&quot; title=&quot;quest.com/powershellbook&quot; id=&quot;imsf&quot;&gt;quest.com/powershellbook&lt;/a&gt; to register for your free copy and see why PowerShell and Quest Power GUI are the ultimate Windows management tools.&lt;/i&gt;&lt;/div&gt;
&lt;p&gt;&lt;i&gt; &lt;/i&gt;&lt;/p&gt; &lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;&lt;li&gt;Go grab&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://powershell.com/cs/forums/p/2814/3756.aspx#3756&quot; title=&quot;PowerShellPlus 3.1 beta&quot; id=&quot;agg7&quot;&gt;PowerShellPlus 3.1 beta&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Brandon Shell's&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bsonposh.com/archives/1070?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+BsOnPosh+%28BS+on+Posh%29&amp;utm_content=Google+Reader&quot; title=&quot;PowerShell Module goes Beta&quot; id=&quot;r-i3&quot;&gt;PowerShell Module goes Beta&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://get-powershell.com/2009/11/06/seattle-powershell-script-club-thurs-nov-19th/&quot; title=&quot;Seattle PowerShell Script Club &amp;#xe2; Thurs Nov 19th&quot; id=&quot;mayq&quot;&gt;Seattle PowerShell Script Club â Thurs Nov 19th&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Sapien Press is&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://jdhitsolutions.com/blog/2009/11/pre-orders-for-windows-powershell-2-0-tfm/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed&quot; title=&quot;taking pre-orders&quot; id=&quot;w_lh&quot;&gt;taking pre-orders&lt;/a&gt; for PowerShell 2.0: TFM&lt;/li&gt;&lt;li&gt;CodePlex news:
&lt;ul&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://psbiztalk.codeplex.com/&quot; title=&quot;PSHBiztalk&quot; id=&quot;m-2a&quot;&gt;PSHBiztalk&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/div&gt; &lt;h2&gt;Interview&lt;/h2&gt;
&lt;p&gt;&lt;i&gt;This segment is brought to you by &lt;/i&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://sapien.com/&quot; title=&quot;SAPIEN Technologies&quot; id=&quot;zah2&quot;&gt;&lt;i&gt;SAPIEN Technologies&lt;/i&gt;&lt;/a&gt;&lt;i&gt;.&lt;/i&gt;&lt;/p&gt; &lt;h4&gt;Links&lt;/h4&gt;
&lt;div&gt;
&lt;ul&gt;&lt;li id=&quot;nr6x&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bsonposh.com/archives/1070&quot;&gt;http://bsonposh.com/archives/1070&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li id=&quot;nele&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://code.msdn.microsoft.com/bsonposh&quot;&gt;http://code.msdn.microsoft.com/bsonposh&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li id=&quot;n5xf&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.loginconsultants.com/index.php?option=com_content&amp;task=view&amp;id=231&amp;Itemid=128&quot; title=&quot;Virtual Session Indexer&quot; id=&quot;uihs&quot;&gt;Virtual Session Indexer&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/div&gt;
&lt;h4&gt;Questions&lt;/h4&gt;
&lt;div&gt;
&lt;ul&gt;&lt;li&gt;AaronHoover: How does management with Hyper-V compare to that with VMware?&lt;/li&gt;&lt;li&gt;jeffculb: ##memory overcomit does ok in vmware... vCPU density is the killer&lt;/li&gt;&lt;li&gt;aerodevil: ##does hyperv thin provision?&lt;/li&gt;&lt;li&gt;glnsize: ##have you used PCoIP&lt;/li&gt;&lt;li&gt;sepeck: ## did I miss the difference between this and the activeroles cmdlets or Microsofts R2 release?&lt;/li&gt;&lt;li&gt;aerodevil: ##get-RebootTime. What does that provide specifically.&lt;/li&gt;&lt;li&gt;jtruman0917: ## so would this also push toward Mobile PoSH&lt;/li&gt;&lt;/ul&gt; &lt;/div&gt;
&lt;h2&gt;&lt;span style=&quot;font-size:medium;&quot;&gt;Resources&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;Jaykul has put out a&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://huddledmasses.org/twitter-in-your-console-prompt-using-ps-jobs-for-background-work/ipmo/&quot; title=&quot;very cool PowerShell Twitter client&quot; id=&quot;ry9-&quot;&gt;very cool PowerShell Twitter client&lt;/a&gt; that uses PSJobs to refresh data in the background and Growl to make &quot;toaster&quot; popups.&lt;/li&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://dmitrysotnikov.wordpress.com/2009/11/03/virtu-al-powerpack-a-must-have-tool-for-vmware/&quot; title=&quot;Virtu-Al PowerPack for VMware&quot; id=&quot;ex3r&quot;&gt;Virtu-Al PowerPack for VMware&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/powershell/archive/2009/11/09/windows-server-2008-r2-rocks.aspx&quot; title=&quot;PowerShell resources from Channel9&quot; id=&quot;negq&quot;&gt;PowerShell resources from Channel9&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Jonathan Medd has started a new series:&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.jonathanmedd.net/2009/11/powershell-2-0-one-cmdlet-at-a-time-1-get-random.html&quot; title=&quot;PowerShell 2.0: One Cmdlet at a Time&quot; id=&quot;peha&quot;&gt;PowerShell 2.0: One Cmdlet at a Time&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;&lt;span style=&quot;font-size:medium;&quot;&gt;Tips&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;[stackoverflow / serverfault ad]&lt;/div&gt; &lt;ul&gt;&lt;li&gt;Rich Siddaway put up&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://richardsiddaway.spaces.live.com/Blog/cns%2143CFA46A74CF3E96%212599.entry&quot; title=&quot;an example of Register-WMIEvent&quot; id=&quot;hqhp&quot;&gt;an example of Register-WMIEvent&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;And another from Rich, this one is&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://richardsiddaway.spaces.live.com/Blog/cns%2143CFA46A74CF3E96%212603.entry&quot; title=&quot;a wrapper for Microsoft's Security Essentials&quot; id=&quot;e:0a&quot;&gt;a wrapper for Microsoft's Security Essentials&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;James Brundage shows us how to&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/powershell/archive/2009/10/30/sending-automated-emails-with-send-mailmessage-convertto-html-and-the-powershellpack-s-taskscheduler-module.aspx&quot; title=&quot;use splatting and a couple of his new cmdlets to send mail in a scheduled task&quot; id=&quot;hvfx&quot;&gt;use splatting and a couple of his new cmdlets to send mail in a scheduled task&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/Powerscripting/~4/4sds2S8-PTg&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>PowerScripting@Gmail.com (Jonathan Walz &amp; Hal Rottenberg)</author>
         <guid isPermaLink="false">http://powerscripting.libsyn.com/index.php?post_id=550193#</guid>
         <pubDate>Mon, 16 Nov 2009 20:38:00 -0800</pubDate>
         <media:content></media:content>
         <category>podcasts</category>
         <enclosure length="40831052" url="http://feedproxy.google.com/~r/Powerscripting/~5/U7myU3FcoC0/PSPodcast-092.mp3" type="audio/mpeg"/>
      </item>
      <item>
         <title>All Hail Dir UseALot!</title>
         <link>http://jdhitsolutions.com/blog/2009/11/all-hail-dir-usealot/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
         <description>Some of you know my relationship with the a command prompt goes back a long, long way. Naturally I became very adept at using the DIR command, fully taking advantage of its switches to tease out hidden information or to quickly get just the information I wanted. When PowerShell first came out, I made the [...]&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?a=Op4WzhkkPEQ:TP3ODYZQEmI:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?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/JeffsScriptingBlogAndMore?a=Op4WzhkkPEQ:TP3ODYZQEmI:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/Op4WzhkkPEQ&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Jeffery Hicks</author>
         <guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=510</guid>
         <pubDate>Mon, 16 Nov 2009 08:30:24 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Powershell Help 2.0 Community Edition</title>
         <link>http://feedproxy.google.com/~r/SapienBlog/~3/YSdlGVogCMM/</link>
         <description>Our Powershell Help tool has been a favorite download for quite some time now. The built-in help command in the Powershell console is helpful if you need just some quick lookup, but for browsing and reading the console just isn&amp;#8217;t good enough.
The CHM file Microsoft released is a pretty nice graphical way of getting help [...]</description>
         <author>Alex Riedel</author>
         <guid isPermaLink="false">http://blog.sapien.com/?p=1928</guid>
         <pubDate>Mon, 16 Nov 2009 01:08:30 -0800</pubDate>
         <content:encoded><![CDATA[<p>Our Powershell Help tool has been a favorite download for quite some time now. The built-in help command in the Powershell console is helpful if you need just some quick lookup, but for browsing and reading the console just isn&#8217;t good enough.</p>
<p>The CHM file Microsoft released is a pretty nice graphical way of getting help for the built-in cmdlets but it&#8217;s a closed file and information for third party or even other Microsoft snapins is not available and cannot be added.</p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/CMDLETHelp.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="201" alt="CMDLETHelp" src="http://blog.sapien.com/wp-content/uploads/2009/11/CMDLETHelp_thumb.png" width="244" border="0"></a><br /><em>Cmdlets organized by popular verbs</em></p>
<p>This new version of our popular Powershell help tool allows importing any xml help file and about files from other vendors and puts all this combined information on your desktop or notebook. Powershell doesn&#8217;t even need to be installed in order to use this.</p>
<p>We have a more detailed QuickGuide available here:<br /><a rel="nofollow" target="_blank" href="http://www.primaltools.com/docs/PowerShell%20Help%20Quick%20Guide.pdf">PowerShell Help Quick Guide</a></p>
<p>You can download this version from here in 32 and 64 bit versions: <a rel="nofollow" target="_blank" href="http://www.primaltools.com/downloads/communitytools/">SAPIEN Community Tools</a></p>
<p>And yes, it is a Community Tool, so it is free with registration.</p>
<p>Here are some more screenshots:</p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/AboutHelp.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="201" alt="AboutHelp" src="http://blog.sapien.com/wp-content/uploads/2009/11/AboutHelp_thumb.png" width="244" border="0"></a><br /><em>Showing About files</em></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/Hyperlinks.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="201" alt="Hyperlinks" src="http://blog.sapien.com/wp-content/uploads/2009/11/Hyperlinks_thumb.png" width="244" border="0"></a><br /><em>Hyperlinked &#8220;Related Links&#8221;</em></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/Online-link.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="201" alt="Online link" src="http://blog.sapien.com/wp-content/uploads/2009/11/Online-link_thumb.png" width="244" border="0"></a><br /><em>Online Links shown in integrated browser</em></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/Search.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="89" alt="Search" src="http://blog.sapien.com/wp-content/uploads/2009/11/Search_thumb.png" width="244" border="0"></a><br /><em>Search cmdlet help and About articles</em></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/Search-Results.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="56" alt="Search Results" src="http://blog.sapien.com/wp-content/uploads/2009/11/Search-Results_thumb.png" width="244" border="0"></a></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/ResultNavButtons.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="146" alt="ResultNavButtons" src="http://blog.sapien.com/wp-content/uploads/2009/11/ResultNavButtons_thumb.png" width="191" border="0"></a><br /><em>Show search results and easily navigate between hits.</em></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/Import.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="134" alt="Import" src="http://blog.sapien.com/wp-content/uploads/2009/11/Import_thumb.png" width="244" border="0"></a><br /><em>Import other help xml files or about articles.</em></p>
<p><a rel="nofollow" target="_blank" href="http://blog.sapien.com/wp-content/uploads/2009/11/Notes.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="56" alt="Notes" src="http://blog.sapien.com/wp-content/uploads/2009/11/Notes_thumb.png" width="244" border="0"></a><br /><em>Take notes and keep them associated with each individual help topic.</em></p> <span class="slashdigglicious">
<a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F&amp;title=Powershell+Help+2.0+Community+Edition" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]"/></a>
<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F&amp;title=Powershell+Help+2.0+Community+Edition" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]"/></a>
<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F&amp;title=Powershell+Help+2.0+Community+Edition" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]"/></a>
<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F&amp;title=Powershell+Help+2.0+Community+Edition" title="Save to del.icio.us"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]"/></a>
<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]"/></a>
<a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]"/></a>
<a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F&amp;title=Powershell+Help+2.0+Community+Edition" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]"/></a>
<a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F16%2Fpowershell-help-2-0-community-edition%2F&amp;title=Powershell+Help+2.0+Community+Edition" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]"/></a>
</span>
 <p class='technorati-tags'>Technorati Tags: <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/community+edition'>community edition</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/Help'>Help</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/powershell'>powershell</a></p> 
<div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=YSdlGVogCMM:qEdEkNt94zE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=YSdlGVogCMM:qEdEkNt94zE:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=I9og5sOYxJI" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=YSdlGVogCMM:qEdEkNt94zE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=7Q72WNTAKBA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=YSdlGVogCMM:qEdEkNt94zE:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=nQ_hWtDbxek" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/SapienBlog/~4/YSdlGVogCMM" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>I Can Do That With 1 Line of PowerShell: Installed Software</title>
         <link>http://blogs.msdn.com/powershell/archive/2009/11/15/i-can-do-that-with-1-line-of-powershell-installed-software.aspx</link>
         <description>&lt;p&gt;Ying Li has a cool PowerShell Script to list installed Software on a local computer &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://myitforum.com/cs2/blogs/yli628/archive/2008/01/16/powershell-script-to-list-installed-software-on-local-computer.aspx&quot;&gt;HERE&lt;/a&gt;.&amp;#160; &lt;/p&gt; &lt;p&gt;When I looked at it and thought to myself, I can do that with 1 line (if I cheat a little).&amp;#160; Here it is:&lt;/p&gt; &lt;p&gt;&lt;font color=&quot;#000080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;PS&amp;gt; gp HKLM:&amp;#92;Software&amp;#92;Microsoft&amp;#92;Windows&amp;#92;CurrentVersionNINSTALL&amp;#92;* |SELECT DISPLAYNAME, DISPLAYVERSION, PUBLISHER, INSTALLDATE, HELPLINK, UNINSTALLSTRING |OGV&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;p&gt;HERE IS WHAT&amp;#160; YOU GET FOR THAT 1 LINE OF CODE:&lt;/p&gt; &lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; HREF=&quot;HTTP://BLOGS.MSDN.COM/BLOGFILES/POWERSHELL/WINDOWSLIVEWRITER/ICANDOTHATWITH1LINEOFPOWERSHELLINSTALLED_8872/IMAGE_2.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://BLOGS.MSDN.COM/BLOGFILES/POWERSHELL/WINDOWSLIVEWRITER/ICANDOTHATWITH1LINEOFPOWERSHELLINSTALLED_8872/IMAGE_THUMB.PNG&quot; WIDTH=&quot;875&quot; HEIGHT=&quot;410&quot;/&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;p&gt;I CHEATED BY USING OGV&amp;#160; (OUT-GRIDVIEW).&amp;#160; YING USED EXCEL AND THE OUTPUT IS NICER.&amp;#160; BUT WHEN YOU ONLY WANT TO SPEND A SINGLE LINE…&amp;#160; :-)&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;p&gt;EXPERIMENT!&amp;#160; ENJOY!&amp;#160; ENGAGE! &lt;/p&gt; &lt;p&gt;JEFFREY SNOVER [MSFT] &lt;br /&gt;DISTINGUISHED ENGINEER &lt;br /&gt;VISIT THE WINDOWS POWERSHELL TEAM BLOG AT:&amp;#160;&amp;#160;&amp;#160; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; HREF=&quot;HTTP://BLOGS.MSDN.COM/POWERSHELL&quot;&gt;HTTP://BLOGS.MSDN.COM/POWERSHELL&lt;/a&gt; &lt;br /&gt;VISIT THE WINDOWS POWERSHELL SCRIPTCENTER AT:&amp;#160; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; HREF=&quot;HTTP://WWW.MICROSOFT.COM/TECHNET/SCRIPTCENTER/HUBS/MSH.MSPX&quot;&gt;HTTP://WWW.MICROSOFT.COM/TECHNET/SCRIPTCENTER/HUBS/MSH.MSPX&lt;/a&gt;&lt;/p&gt;&lt;img SRC=&quot;HTTP://BLOGS.MSDN.COM/AGGBUG.ASPX?POSTID=9922651&quot; WIDTH=&quot;1&quot; HEIGHT=&quot;1&quot;&gt;</description>
         <author>PowerShellTeam</author>
         <guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922651</guid>
         <pubDate>Sun, 15 Nov 2009 09:42:37 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Signing PowerShell Scripts – Automatically</title>
         <link>http://feedproxy.google.com/~r/HuddledMasses/~3/dl7y0Fu8ptU/</link>
         <description>I write a lot of PowerShell scripts, and I work on modules a lot, including ones which I load automatically in my profile. Sometimes I forget to sign those modules before I restart my console/host, and then I get errors when they&amp;#8217;re loaded from the profile. I wrote a script to solve this [...]</description>
         <author>Joel 'Jaykul' Bennett</author>
         <guid isPermaLink="false">http://huddledmasses.org/?p=1317</guid>
         <pubDate>Sat, 14 Nov 2009 21:53:56 -0800</pubDate>
         <content:encoded><![CDATA[<p>I write a lot of PowerShell scripts, and I work on modules a lot, including ones which I load automatically in my profile. Sometimes I forget to sign those modules before I restart my console/host, and then I get errors when they&#8217;re loaded from the profile. I wrote a script to solve this problem by automatically signing files every time they&#8217;re edited, and I figured I&#8217;d share it below, but first let me try explaining what code signing is, and why you should care.</p> <h3>What is code signing?</h3> <p><a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Code_signing">Code signing</a> is the process of digitally signing files to confirm the author and guarantee that the file has not been altered or corrupted. It&#8217;s essentially the same as signing emails: it guarantees that they were actually authored by the person claiming to be the author, and that they weren&#8217;t changed after the author signed them. (For more information see <a rel="nofollow" target="_blank" href="http://developer.apple.com/mac/library/documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html#//apple_ref/doc/uid/TP40005929-CH3-SW3">Apple&#8217;s explanation</a> and <a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/ms537361%28VS.85%29.aspx">Microsoft&#8217;s</a>).</p> <h3>How does digital signing work?</h3> <p>Basically, digital signing is cryptography, so a full understanding of it really requires taking a 400-level college course, but <a rel="nofollow" target="_blank" href="http://www.instantssl.com/code-signing/code-signing-process.html">here are the basics</a>: You take some data (binary bits) and use a well-known algorithm to calculate what is called a &#8220;hash&#8221; of the bits. This hash is mathematically-generated from the source data, and so it can be re-calculated by the receiver. The hash is then &#8220;signed&#8221; via another algorithm: using a private key (see <a rel="nofollow" target="_blank" href="http://www.answers.com/topic/pki#Computer_Desktop_Encyclopedia_d_ans">Public Key Infrastructure</a> (<span class="caps">PKI</span>) for more about how these keys are managed) the signer encrypts the hash and attaches it to the file. </p> <p>With public/private key encryption, data that is encrypted by the private key can be decrypted by the public key, so the encryption of the hash (and sometimes the public key, as well) is attached to the file so that the end user can re-calculate the hash and decrypt the signature to verify: a) that it was encrypted by the private key belonging to the author, and b) that the hash matches the hash that the author signed.</p> <h3>What&#8217;s all this about keys?</h3> <p>In <span class="caps">PKI</span>, the &#8220;key&#8221; is actually part of what&#8217;s called an <a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Ssl_certificate"><span class="caps">SSL</span> certificate</a> issued to you by a Certificate Authority (CA) who verifies your identity. Verisign introduced the idea of &#8220;classes&#8221; for certificates, and you can now get free, <strong>Class 1</strong> certificates for email signing from most CA&#8217;s now (like <a rel="nofollow" target="_blank" href="http://www.thawte.com/secure-email/personal-email-certificates/">Thawte</a> and <a rel="nofollow" target="_blank" href="http://www.thawte.com/secure-email/personal-email-certificates/">Comodo</a> and <a rel="nofollow" target="_blank" href="http://www.startssl.com/?app=1">StartCOM</a>), where the only thing they <em>verify</em> is that the person being issued the certificate can send/receive email at that address.</p> <p>Of course, if you want to verify yourself as the author of <strong>code,</strong> we want to know more about you than your email address. So to sign code, you need <em>at least</em> a <strong>Class 2</strong> certificate, for which proof of identity is required. This typically comes in the form of providing (photos of) your passport, driver&#8217;s license and/or other photo ID to verify that you are who you claim to be, and answering a few questions on the phone to validate that you own the phone number provided&#8230; or providing tax or other documents to prove the existence of an organization and that you&#8217;re qualified to speak for them. There are also additional classes: Class 3, 4, and 5 are extended validation certificates used for servers, software signing, b2b transactions and government security.</p> <h3>Why should I sign PowerShell scripts?</h3> <p>Well, the chances are, you don&#8217;t need to. Script signing is really a feature for corporations. The idea is that scripts from your IT department need to be verifiable and unalterable&#8230; code-signing gives companies a way to lock down and secure PowerShell scripts: setting a global policy requiring script signing, and ensuring that all scripts produced by the corporate administrators are properly signed&#8230;</p> <p>As an individual, script-signing doesn&#8217;t really offer you much unless you share your computer with other administrator users. After all, what it protects you from is intentional or accidental altering of the script. If there&#8217;s no one else who has access to your computer, then nobody can alter your scripts. Of course, if someone <em>hacks</em> your computer enough to alter or create files on your hard drive and wanted to do something malicious, scripts would be a silly thing to target <img src='http://huddledmasses.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'/> </p> <p>There is, however, one additional time when you might want to sign your scripts. If you&#8217;re distributing scripts, whether via <a rel="nofollow" target="_blank" href="http://PoshCode.org">PoshCode.org</a>, the TechNet script gallery, or on CodePlex or the <span class="caps">MSDN</span> code gallery &#8230; signing them gives you (and your users) the assurance that <strong>you</strong> are the author, and they haven&#8217;t been altered. In fact, the PoshCode Module which is available on <a rel="nofollow" target="_blank" href="http://PoshCode.org">PoshCode.org</a>, and which allows you to search and download (as well as upload) PoshCode scripts uses script signing to allow it to safely upgrade itself. It features a <code>Get-PoshCode -Upgrade</code> command which will check for, and fetch, the latest version of the PoshCode module, and then validate it&#8217;s code signature is the same as the previous one before using it.</p> <p>Remember, code signing <strong>cannot</strong>:</p> <ul> <li>Guarantee that code is free of security vulnerabilities.</li> <li>Guarantee that a script doesn&#8217;t load unsafe or altered code during execution.</li> </ul> <ul> <li>Prevent copying or altering of your scripts (although PowerShell policies can prevent <em>accidental execution</em> of altered scripts).</li> </ul> <h2>How do I sign scripts?</h2> <p>Assuming that after skimming all of that, you want to try signing your scripts, you need a certificate. You can <a rel="nofollow" target="_blank" href="http://huddledmasses.org/code-signing-with-openssl-and-powershell/">generate one yourself</a> (although it&#8217;s not easy, and the signed scripts which will only work locally on your system, and won&#8217;t be trusted by anyone else) or you can get one from a public Certificate Authority (I recommend <a rel="nofollow" target="_blank" href="http://www.startssl.com/?app=2">StartCom/StartSSL</a> which only costs $40 for two year certificates). </p> <p>Typically, your certificate will be a .pfx file which you can load using <code>Get-PfxCertificate</code>, or you might have imported it into your local certificate store using CertMgr.msc, in which case you can load it using Get-Item Cert:&#92;CurrentUser&#92;My&#92; with the thumbprint of the certificate. In either case, you&#8217;ll have a certificate object you can pass to <code>Set-AuthenticodeSignature</code> along with the file path.</p> <h1>Wasn&#8217;t there supposed to be something automatic here?</h1> <p>Awhile back I wrote an <a rel="nofollow" target="_blank" href="http://poshcode.org/1473">Authenticode Script Module</a> which has wrappers for signing and testing signatures on scripts. It uses a metadata file (which you have to create yourself) with a <code>PrivateData</code> variable that points to either the thumbprint of a certificate you&#8217;ve imported to your computer&#8217;s certificate store, or the path to a .pfx file &#8230; and allows you to sign files by just writing <code>sign .&#92;FileToSign.ps1</code> without having to Get-PfxCertificate each time, or even remember to turn on the -TimeStampUrl feature so that your signed scripts stay signed even after the certificate expires. That script helps a lot, but I&#8217;ve been wanting my text editor to sign the scripts automatically when I save them &#8230;</p> <p>I mostly use <a rel="nofollow" target="_blank" href="http://notepad-plus.sourceforge.net/">Notepad++</a> for editing PowerShell scripts (with a <a rel="nofollow" target="_blank" href="http://PoshCode.org/notepad++lexer">PowerShell Syntax lexer I helped create</a>), but after playing with the idea of writing a plugin to sign things after saving, I ended up deciding to go with something simpler: a PowerShell script to watch a folder for changes and sign any scripts I edit or save.</p> <p>I&#8217;ve added a function I call <code>Start-AutoSign</code> to my <a rel="nofollow" target="_blank" href="http://poshcode.org/1473">authenticode script module</a> which takes a path and a <code>-Recurse</code> flag and sets up a <a rel="nofollow" target="_blank" href="http://msdn.com/System.IO.FileSystemWatcher">System.IO.FileSystemWatcher</a> to detect saves, creates, and moves &#8230; and (re)sign the script if it needs it. Here is <code>Start-AutoSign</code> without the help docs or anything (so I can discuss it). You should just download the whole <a rel="nofollow" target="_blank" href="http://poshcode.org/1473">script module</a> if you want to use it <img src='http://huddledmasses.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'/> </p> <div class="posh code posh" style="font-family:monospace;"><span style="color:#666699;font-weight:bold;">PARAM</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$Path</span><span style="color:#66cc66;">=</span><span style="color:#009900;">"."</span>, <span style="color:#660033;font-weight:bold;">$Filter</span><span style="color:#66cc66;">=</span> <span style="color:#009900;">"*.ps*"</span>, <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#666699;font-weight:bold;">Switch</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$Recurse</span>, <span style="color:#660033;font-weight:bold;">$CertPath</span>, <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#666699;font-weight:bold;">Switch</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$NoNotify</span><span style="color:#333;">&#41;</span><br />
<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#66cc66;">!</span><span style="color:#660033;font-weight:bold;">$NoNotify</span> <span style="color:#000066;">-and</span> <span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Module</span></span> Growl <span style="color:#000066;">-ListAvailable</span> <span style="color:#000066;">-ErrorAction</span> <span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Import-<span style="font-style:normal;">Module</span></span> Growl<br />
&nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Register-<span style="font-style:normal;">GrowlType</span></span> AutoSign <span style="color:#009900;">"Signing File"</span> <span style="color:#000066;">-ErrorAction</span> <span style="color:#cc66cc;">0</span><br />
<span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">else</span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$NoNotify</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$false</span> <span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#660033;font-weight:bold;">$realItem</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Item</span></span> <span style="color:#660033;font-weight:bold;">$Path</span> <span style="color:#000066;">-ErrorAction</span> Stop<br />
<span style="color:#666699;font-weight:bold;">if</span> <span style="color:#333;">&#40;</span><span style="color:#66cc66;">-</span><span style="color:#333399;font-weight:bold;font-style:italic;">not</span> <span style="color:#660033;font-weight:bold;">$realItem</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <span style="color:#666699;font-weight:bold;">return</span> <span style="color:#333;">&#125;</span> <br />
<br />
<span style="color:#660033;font-weight:bold;">$Action</span> <span style="color:#66cc66;">=</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$InvalidForm</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"The form specified for the subject is not one supported or known by the specified trust provider"</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">ForEach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$file</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">ChildItem</span></span> <span style="color:#660033;font-weight:bold;">$eventArgs</span>.<span style="color:#003366;">FullPath</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">AuthenticodeSignature</span></span> <span style="color:#66cc66;">|</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Where-<span style="font-style:normal;">Object</span></span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$_</span>.<span style="color:#003366;">Status</span> <span style="color:#000066;">-ne</span> <span style="color:#009900;">"Valid"</span> <span style="color:#000066;">-and</span> <span style="color:#660033;font-weight:bold;">$_</span>.<span style="color:#003366;">StatusMessage</span> <span style="color:#000066;">-ne</span> <span style="color:#660033;font-weight:bold;">$invalidForm</span> <span style="color:#333;">&#125;</span> <span style="color:#66cc66;">|</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Select-<span style="font-style:normal;">Object</span></span> <span style="color:#000066;">-ExpandProperty</span> Path <span style="color:#333;">&#41;</span> <br />
&nbsp; &nbsp;<span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#66cc66;">!</span><span style="color:#660033;font-weight:bold;">$NoNotify</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Send-<span style="font-style:normal;">Growl</span></span> AutoSign <span style="color:#009900;">"Signing File"</span> <span style="color:#009900;">"File $($eventArgs.ChangeType), signing:"</span> <span style="color:#009900;">"$file"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$CertPath</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">AuthenticodeSignature</span></span> <span style="color:#000066;">-FilePath</span> <span style="color:#660033;font-weight:bold;">$file</span> <span style="color:#000066;">-Certificate</span> <span style="color:#660033;font-weight:bold;">$CertPath</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">else</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">AuthenticodeSignature</span></span> <span style="color:#000066;">-FilePath</span> <span style="color:#660033;font-weight:bold;">$file</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<span style="color:#660033;font-weight:bold;">$watcher</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Object</span></span> IO.<span style="color:#003366;">FileSystemWatcher</span> <span style="color:#660033;font-weight:bold;">$realItem</span>.<span style="color:#003366;">Fullname</span>, <span style="color:#660033;font-weight:bold;">$filter</span> <span style="color:#000066;">-Property</span> @<span style="color:#333;">&#123;</span> IncludeSubdirectories <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$Recurse</span> <span style="color:#333;">&#125;</span><br />
<span style="color:#0066cc;font-style:italic;">Register-<span style="font-style:normal;">ObjectEvent</span></span> <span style="color:#660033;font-weight:bold;">$watcher</span> <span style="color:#009900;">"Created"</span> <span style="color:#009900;">"AutoSignCreated$($realItem.Fullname)"</span> <span style="color:#000066;">-Action</span> <span style="color:#660033;font-weight:bold;">$Action</span> <span style="color:#66cc66;">&amp;</span>gt; <span style="color:#660033;font-weight:bold;">$null</span><br />
<span style="color:#0066cc;font-style:italic;">Register-<span style="font-style:normal;">ObjectEvent</span></span> <span style="color:#660033;font-weight:bold;">$watcher</span> <span style="color:#009900;">"Changed"</span> <span style="color:#009900;">"AutoSignChanged$($realItem.Fullname)"</span> <span style="color:#000066;">-Action</span> <span style="color:#660033;font-weight:bold;">$Action</span> <span style="color:#66cc66;">&amp;</span>gt; <span style="color:#660033;font-weight:bold;">$null</span><br />
<span style="color:#0066cc;font-style:italic;">Register-<span style="font-style:normal;">ObjectEvent</span></span> <span style="color:#660033;font-weight:bold;">$watcher</span> <span style="color:#009900;">"Renamed"</span> <span style="color:#009900;">"AutoSignChanged$($realItem.Fullname)"</span> <span style="color:#000066;">-Action</span> <span style="color:#660033;font-weight:bold;">$Action</span> <span style="color:#66cc66;">&amp;</span>gt; <span style="color:#660033;font-weight:bold;">$null</span></div> <p>A few things to notice: first, I&#8217;m assuming you&#8217;re using <strong>my</strong> Set-AuthenticodeSignature wrapper, so by default I don&#8217;t pass it an actual certificate. Second, in order to avoid eternally looping and re-signing the script over-and-over, you have to have a way to make sure you don&#8217;t re-sign it when it &#8220;changes&#8221; because you signed it. The approach I took was to test and see if the signature was valid or not (and if it&#8217;s valid, then don&#8217;t sign it <em>again</em>). Third: when you <code>Get-AuthenticodeSignature</code>, the Status codes leave much to be desired, returning the same &#8220;UnknownError&#8221; in several cases where they know <em>exactly</em> what the error is. You can check the StatusMessage and see that they even <strong>tell</strong> you what the error was:</p> <ul> <li>The form specified for the subject is not one supported or known by the specified trust provider</li> <li>A certificate chain could not be built to a trusted root authority</li> <li>A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider</li> </ul> <ul> <li>A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file</li> </ul> <p>There may be other reasons too that I haven&#8217;t encountered yet, but the one thing we&#8217;re concerned with is the first one that the &#8220;form&#8221; isn&#8217;t supported. That means this is a file type which Set-AuthenticodeSignature can&#8217;t sign. PowerShell&#8217;s signing only works with executables, PowerShell scripts, modules, metadata, and xml files &#8230; so there&#8217;s no point trying to sign anything else. You may also notice that in my script (by default) I&#8217;m only signing .ps* files (that is: scripts, modules, metadata and ps1xml files), and that&#8217;s because with .dll and .exe files, I would prefer to sign them as part of my build step anyway.</p> <p>One last thing: as with a few of my recent scripts, this one is designed to use <a rel="nofollow" target="_blank" href="http://GrowlForWindows.com">Growl for Windows</a> to notify you whenever it signs anything. If you don&#8217;t have the <a rel="nofollow" target="_blank" href="http://poshcode.org/1464">Growl module</a> available, it should just skip right over that without any problems, but you can disable it in any case with the <code>-NoNotify</code> switch. Personally, I like seeing the popup so that I know it&#8217;s working, and know that I&#8217;m not accidentally signing something &#8230; and I love Growl for script notices because I can skin it, configure sounds, and forward the notices to other machines &#8230; or even temporarily disable them, all without having to tweak scripts.</p> <div class="zemanta-pixie"><a rel="nofollow" class="zemanta-pixie-a" target="_blank" href="http://reblog.zemanta.com/zemified/3a72101f-e58c-47ed-accc-fc1c866ae964/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=3a72101f-e58c-47ed-accc-fc1c866ae964" alt="Reblog this post [with Zemanta]"/></a><span class="zem-script more-related pretty-attribution"></span></div><div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=dl7y0Fu8ptU:L2w0JcSFwlk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=dl7y0Fu8ptU:L2w0JcSFwlk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?i=dl7y0Fu8ptU:L2w0JcSFwlk:F7zBnMyn0Lo" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=dl7y0Fu8ptU:L2w0JcSFwlk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?i=dl7y0Fu8ptU:L2w0JcSFwlk:D7DqB2pKExk" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/HuddledMasses/~4/dl7y0Fu8ptU" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Patch Tuesday</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2617.entry</link>
         <description>&lt;p&gt;Patch Tuesday – the second Tuesday in the month – is the day Microsoft (and other vendors) release their patches. If you want to be able to plan ahead for these dates ( like arranging holiday or sick leave ) these two functions will supply the dates to look out for.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;019&lt;br /&gt;020&lt;br /&gt;021&lt;br /&gt;022&lt;br /&gt;023&lt;br /&gt;024&lt;br /&gt;025&lt;br /&gt;026&lt;br /&gt;027&lt;br /&gt;028&lt;br /&gt;029&lt;br /&gt;030&lt;br /&gt;031&lt;br /&gt;032&lt;br /&gt;033&lt;br /&gt;034&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get-secondTuesday&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:#00008b;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[datetime]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&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:#00008b;&quot;&gt;switch&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:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;DayOfWeek&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:#8b0000;&quot;&gt;&quot;Sunday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;9&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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:#8b0000;&quot;&gt;&quot;Monday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;8&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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:#8b0000;&quot;&gt;&quot;Tuesday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;7&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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:#8b0000;&quot;&gt;&quot;Wednesday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;13&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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:#8b0000;&quot;&gt;&quot;Thursday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;12&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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:#8b0000;&quot;&gt;&quot;Friday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;11&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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:#8b0000;&quot;&gt;&quot;Saturday&quot;&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:#ff4500;&quot;&gt;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;AddDays&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;10&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; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;break&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;}&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;$patchTuesday&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ToLongDateString&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;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Get-PatchTuesday&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:#00008b;&quot;&gt;param&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:#a9a9a9;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#add8e6;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ValueFromPipeline&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;span style=&quot;color:#a9a9a9;&quot;&gt;]&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;[int]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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:#0000ff;&quot;&gt;Get-Date&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Year&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[switch]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$nextmonth&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$nextmonth&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:#ff4500;&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Date&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;$d&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Date&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Day&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Month&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:#ff4500;&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Month&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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:#000080;&quot;&gt;-Year&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Year&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-secondTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$d&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:#00008b;&quot;&gt;else&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:#800080;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#ff4500;&quot;&gt;$d&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[datetime]&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;$_/1/$year&quot;&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-secondTuesday&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$d&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;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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Get-PatchTuesday takes a year (default is current year) and works out the first of each month as a date. This is passed to get-secondtuesday to calculate the date the patches will be released.&lt;/p&gt; &lt;p&gt;If the –nextmonth parameter is used then the first of next month is calculated and the patch date for that month retrieved from getsecondtuesday.&lt;/p&gt; &lt;p&gt;Dates for the next few months are&lt;/p&gt; &lt;p&gt;08 December 2009&lt;br /&gt;12 January 2010&lt;br /&gt;09 February 2010&lt;br /&gt;09 March 2010&lt;br /&gt;13 April 2010&lt;br /&gt;11 May 2010&lt;br /&gt;08 June 2010&lt;br /&gt;13 July 2010&lt;br /&gt;10 August 2010&lt;br /&gt;14 September 2010&lt;br /&gt;12 October 2010&lt;br /&gt;09 November 2010&lt;br /&gt;14 December 2010 &lt;p&gt;Time to start planning.&lt;/p&gt; &lt;p&gt;These functions can be adapted to provide dates for any date that follows the pattern of nth weekday.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/dates&quot;&gt;dates&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/patch+Tuesday&quot;&gt;patch Tuesday&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2617</guid>
         <pubDate>Sat, 14 Nov 2009 20:14:39 -0800</pubDate>
         <media:content></media:content>
         <category>Powershell</category>
      </item>
      <item>
         <title>Friday 13th Part II</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2615.entry</link>
         <description>&lt;p&gt; &lt;/p&gt; &lt;p&gt;No not the film&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;get-fri13&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:#006400;&quot;&gt;&amp;lt;# .SYNOPSIS Calculates each Friday 13th for a given year .DESCRIPTION .PARAMETER year Specifies the year as an integer .EXAMPLE for current year get-fri13 for single year get-fr13 2010 for multiple years 2010..2020 | foreach {get-fri13 $_} .INPUTS Year as Integer #&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;param&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:#a9a9a9;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#add8e6;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ValueFromPipeline&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;span style=&quot;color:#a9a9a9;&quot;&gt;]&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;[int]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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:#0000ff;&quot;&gt;Get-Date&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Year&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:#800080;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#ff4500;&quot;&gt;$d&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[datetime]&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;$_/13/$year&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$d&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;DayOfWeek&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Friday&quot;&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:#ff4500;&quot;&gt;$d&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ToLongDateString&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;}&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;With the last friday 13th out of the way for this year I thought I’d convert my script into a function while I was seeing what next year brings. Its the first function in my datetime module and I’ve added some comment based help.&lt;/p&gt; &lt;p&gt;One quick point – if you use mandatory=$true in the parameter block it overrides the default value and expects a value to be given&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/dates&quot;&gt;dates&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2615</guid>
         <pubDate>Sat, 14 Nov 2009 17:14:13 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>Scheduled Tasks</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2607.entry</link>
         <description>&lt;p&gt;Keeping on the theme of Scheduled Tasks I wanted to dig into the tasks that exist on my system. I did a fresh install of Windows 7 in August and haven’t created any scheduled tasks – so what I see should be close to the system defaults. This machine isn’t in a domain.&lt;/p&gt; &lt;p&gt;I can load the task scheduler functions&lt;/p&gt; &lt;p&gt;PS&amp;gt; Import-Module TaskScheduler&lt;br /&gt;PS&amp;gt; get-command -Module TaskScheduler &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;CommandType Name&lt;br /&gt;----------- ----&lt;br /&gt;Function Add-TaskAction&lt;br /&gt;Function Add-TaskTrigger&lt;br /&gt;Function Connect-ToTaskScheduler&lt;br /&gt;Function Get-RunningTask&lt;br /&gt;Function Get-ScheduledTask&lt;br /&gt;Function New-Task&lt;br /&gt;Function Register-ScheduledTask&lt;br /&gt;Function Remove-Task&lt;br /&gt;Function Start-Task&lt;br /&gt;Function Stop-Task&lt;/font&gt; &lt;p&gt;I can see the tasks that are running &lt;p&gt;PS&amp;gt; Get-RunningTask &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Name : SystemSoundsService&lt;br /&gt;InstanceGuid : {9E499B76-8A4E-4215-B043-619B0403D8F6}&lt;br /&gt;Path : &amp;#92;Microsoft&amp;#92;Windows&amp;#92;Multimedia&amp;#92;SystemSoundsService&lt;br /&gt;State : 4&lt;br /&gt;CurrentAction : Microsoft PlaySoundService Class&lt;br /&gt;EnginePID : 2456&lt;/font&gt; &lt;p&gt;in this case the definition is empty so I can’t see exactly what it is doing though the path and name give a strong hint its related to the sound system.&lt;/p&gt; &lt;p&gt;Scheduled tasks are arranged in a folder hierarchy. If you want to see the full list use&lt;/p&gt; &lt;p&gt;Get-ScheduledTask –Recurse&lt;/p&gt; &lt;p&gt;we see a large number of jobs that are either disabled, ready or running.&lt;/p&gt; &lt;p&gt;If you compare the list with the Task scheduler GUI tool you will see some jobs are missing. These can be viewed by using the hidden switch&lt;/p&gt; &lt;p&gt;Get-ScheduledTask -Recurse -Hidden | select path, name&lt;/p&gt; &lt;p&gt;It is also possible to directly supply a folder and view the jobs in there.&lt;/p&gt; &lt;p&gt;Looking at the total job population&lt;/p&gt; &lt;p&gt;PS&amp;gt; Get-ScheduledTask -Recurse -Hidden | group status &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Count Name &lt;br /&gt;----- ---- &lt;br /&gt; 57 Ready &lt;br /&gt; 20 Disabled &lt;br /&gt; 2 Running &lt;br /&gt; 1 Queued&lt;/font&gt; &lt;p&gt;The Ready jobs look interesting&lt;/p&gt; &lt;p&gt;Get-ScheduledTask -recurse -hidden | where {$_.status -eq &quot;Ready&quot; -and $_.LastRunTime -gt $((get-date).AddMonths(-1))} | sort LastRunTime -Descending &lt;p&gt;will show everything run in the last month that is ready to run again. Surprising just how many back ground tasks occur.&lt;/p&gt; &lt;p&gt;Next time we’ll look at setting up a task to run when we login.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/v2&quot;&gt;v2&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Scheduled+task&quot;&gt;Scheduled task&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/windows+7&quot;&gt;windows 7&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2607</guid>
         <pubDate>Fri, 13 Nov 2009 15:41:36 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>The PowerShell Balloon Festival</title>
         <link>http://jdhitsolutions.com/blog/2009/11/the-powershell-balloon-festival/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
         <description>I trust by now you are realizing how valuable Windows PowerShell is as a management tool. With a one line command you can accomplish an extraordinary amount of work. Sometimes this work may be long running, which is where background jobs come in handy. Or you may simply kick off a long running script and [...]&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?a=QEbKfX4H980:swf_p1k2Y_o:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?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/JeffsScriptingBlogAndMore?a=QEbKfX4H980:swf_p1k2Y_o:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/QEbKfX4H980&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Jeffery Hicks</author>
         <guid isPermaLink="false">http://jdhitsolutions.com/blog/?p=501</guid>
         <pubDate>Fri, 13 Nov 2009 07:30:29 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (11/13/09)</title>
         <link>http://blogs.technet.com/heyscriptingguy/archive/2009/11/13/hey-scripting-guy-november-13-2009.aspx</link>
         <description>In this post : Dealing with Quarantined File Types and Exchange Server Scanning Multiple Remote Computers and Creating a Resultant CSV File How Can I Check for the Latest Daylight Saving Time Update? Troubleshooting the Use of WSMan with Windows PowerShell...(&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/heyscriptingguy/archive/2009/11/13/hey-scripting-guy-november-13-2009.aspx&quot;&gt;read more&lt;/a&gt;)&lt;img src=&quot;http://blogs.technet.com/aggbug.aspx?PostID=3292168&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>ScriptingGuy</author>
         <guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3292168</guid>
         <pubDate>Fri, 13 Nov 2009 00:01:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes</title>
         <link>http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes/</link>
         <description>This Sunday at midnight PST marks the closing of our second annual PowerPack Challenge contest.&amp;#160; The rules of this contest are very simple: create a new PowerPack or modify one of your existing PowerPacks and submit it to the contest folder in the PowerPack Library for a chance to win some cool prizes.&amp;#160; Now you [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=poshoholic.com&amp;blog=1436967&amp;post=278&amp;subd=kirkmunro&amp;ref=&amp;feed=1&quot;/&gt;</description>
         <author>Kirk Munro</author>
         <guid isPermaLink="false">http://poshoholic.com/?p=278</guid>
         <pubDate>Thu, 12 Nov 2009 22:43:35 -0800</pubDate>
         <content:encoded><![CDATA[<div class='snap_preview'><br /><p>This Sunday at midnight PST marks the closing of our second annual <a rel="nofollow" title="PowerPack Challenge" target="_blank" href="http://powergui.org/powerpackchallenge.jspa">PowerPack Challenge</a> contest.&#160; The rules of this contest are very simple: create a new PowerPack or modify one of your existing PowerPacks and submit it to the <a rel="nofollow" title="PowerPack Challenge entry folder" target="_blank" href="http://www.powergui.org/kbcategory.jspa?categoryID=296">contest folder</a> in the <a rel="nofollow" title="PowerPack Library" target="_blank" href="http://www.powergui.org/kbcategory.jspa?categoryID=21">PowerPack Library</a> for a chance to win some cool prizes.&#160; Now you might be thinking: "Sunday, but that&#8217;s&#160; just three days away&#8230;I don&#8217;t have time to put together an entry between now and Sunday. Besides, I want my weekend to myself!"&#160; Well, you&#8217;re in luck my friend because you don&#8217;t need three days&#8230;you only need 10 minutes (well, 10 minutes after you watch a screencast showing what you can do with PowerShell, the PowerGUI Admin Console, and 10 minutes of your time).&#160; That&#8217;s not even going to take up your whole lunch hour on Friday, and if you plan to go out for lunch you could make your PowerPack during your afternoon break instead!</p>
<p>Here&#8217;s all you need to do:</p>
<p>1.&#160; Bookmark the <a rel="nofollow" title="PowerPacks" target="_blank" href="http://wiki.powergui.org/index.php/PowerPacks">PowerPack section</a> of the wiki.&#160; I published a big update to our wiki earlier this week and it should be able to answer a lot of questions you might have.&#160; Don&#8217;t read the whole thing right now though, that might take too long and what you really want to do right now is explained in the next step.</p>
<p>2.&#160; Watch <a rel="nofollow" title="Create a PowerPack in 10 Minutes" target="_blank" href="http://powergui.org/entry.jspa?externalID=2571&amp;categoryID=53">this screencast</a> (also shown below on YouTube) that shows how I created a cool <a rel="nofollow" title="Windows Server Roles and Features PowerPack" target="_blank" href="http://powergui.org/entry.jspa?externalID=2571&amp;categoryID=21">Windows Server Roles and Features PowerPack</a> from scratch earlier today and published it to the <a rel="nofollow" title="PowerPack Library" target="_blank" href="http://powergui.org/kbcategory.jspa?categoryID=21">PowerPack Library</a> in only 10 minutes.&#160; The PowerPack even has dynamic nodes generated from 4 script nodes, which used to be quite a lot of work but thanks to the <a rel="nofollow" title="AdminConsole Module" target="_blank" href="http://powergui.org/entry.jspa?externalID=2572&amp;categoryID=299">AdminConsole module</a> they are much, much easier now.&#160; In fact, if you pay close attention to the screencast, you&#8217;ll see that all of the functionality in the PowerPack itself is done with only 7 lines of PowerShell script plus one basic node and two basic actions &#8212; that&#8217;s pretty amazing.&#160; The entire screencast is longer than 10 minutes because I needed to explain a few things before and after the demonstration, but the creation and publishing of the PowerPack itself is done in only 10 minutes during the screencast.</p>
<p><span style="text-align:center;display:block;"><a rel="nofollow" target="_blank" href="http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes/"><img src="http://img.youtube.com/vi/RYKjH3Mb4do/2.jpg" alt=""/></a></span></p>
<p>Now that I&#8217;ve armed you with the <a rel="nofollow" title="PowerPacks" target="_blank" href="http://wiki.powergui.org/index.php/PowerPacks">wiki documentation</a> and the <a rel="nofollow" title="Create a PowerPack in 10 minutes" target="_blank" href="http://powergui.org/shares/powergui/sbin/docs/Create_a_PowerPack_in_10_Minutes/Create_a_PowerPack_in_10_Minutes.html">screencast demo</a>, I&#8217;ll be looking forward to seeing your PowerPacks in the <a rel="nofollow" title="PowerPack Library" target="_blank" href="http://powergui.org/kbcategory.jspa?categoryID=21">PowerPack Library</a> after your lunch or afternoon break! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley'/> </p>
<p>Good luck with your PowerPacks!</p>
<p>Kirk out.</p>

<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9a68a2f6-b16f-48b4-ae91-3db0a45f7000" class="wlWriterEditableSmartContent">Mots clés Technorati : <a rel="nofollow" target="_blank" href="http://technorati.com/tags/PowerShell">PowerShell</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/PoSh">PoSh</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/Poshoholic">Poshoholic</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/PowerGUI">PowerGUI</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/PowerPack">PowerPack</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/PowerPack+Challenge">PowerPack Challenge</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/Poshoholic+Studios">Poshoholic Studios</a>,<a rel="nofollow" target="_blank" href="http://technorati.com/tags/Quick+Tip">Quick Tip</a></div>
<p> <span class="sbmLink"></span><br />
<table cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td class="sbmText">Share this post: </td>
<td><a rel="nofollow" title="Post it to Social!" target="_blank" href="http://social.microsoft.com/en-us/action/create/s/E/?url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;ttl=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/social.png"/></a></td>
<td><a rel="nofollow" title="Post it to MSDN!" target="_blank" href="http://social.msdn.microsoft.com/en-us/action/create/s/E/?url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;ttl=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/msdn.png"/></a></td>
<td><a rel="nofollow" title="Post it to Technet!" target="_blank" href="http://social.technet.microsoft.com/en-us/action/create/s/E/?url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;ttl=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/technet.png"/></a></td>
<td><a rel="nofollow" title="Post it to Expression!" target="_blank" href="http://social.expression.microsoft.com/en-us/action/create/s/E/?url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;ttl=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://www.dotnetscraps.com/dotnetscraps/samples/sbmtool/expression.png"/></a></td>
<td><a rel="nofollow" title="Post it to Live!" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;mkt=en-us&amp;url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;title=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/live4.png"/></a></td>
<td><a rel="nofollow" title="Post it to Del.icio.us!" target="_blank" href="http://del.icio.us/post?url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;;title=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliciou4.png"/></a></td>
<td><a rel="nofollow" title="Post it to Del.iri.ous!" target="_blank" href="http://de.lirio.us/bookmarks/sbmtool?action=add&amp;address=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;title=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/deliriou4.png"/></a></td>
<td><a rel="nofollow" title="Post it to Digg!" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;title=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/digg14.png"/></a></td>
<td><a rel="nofollow" title="Post it to Facebook!" target="_blank" href="http://www.facebook.com/sharer.php?u=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;t=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.technet.com/photos/james/images/1765319/original.aspx"/></a></td>
<td><a rel="nofollow" title="Post it to Reddit!" target="_blank" href="http://reddit.com/submit?url=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;title=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/reddit4.png"/></a></td>
<td><a rel="nofollow" title="Post it to Technorati!" target="_blank" href="http://technorati.com/faves/?add=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;title=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/technora4.png"/></a></td>
<td><a rel="nofollow" title="Post it to Yahoo!" target="_blank" href="http://myweb.yahoo.com/myresults/bookmarklet?u=http://poshoholic.com/2009/11/13/powergui-quick-tip-create-a-powerpack-from-start-to-finish-in-10-minutes&amp;t=PowerGUI Quick Tip: Create a PowerPack from start to finish in 10 minutes"><img border="0" src="http://blogs.msdn.com/blogfiles/rahulso/WindowsLiveWriter/IconsfordifferentSocialBookmarkingSites_B387/yahoo9.png"/></a></td>
</tr>
</tbody>
</table> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/kirkmunro.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kirkmunro.wordpress.com/278/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/kirkmunro.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kirkmunro.wordpress.com/278/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/kirkmunro.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kirkmunro.wordpress.com/278/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/kirkmunro.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kirkmunro.wordpress.com/278/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/kirkmunro.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kirkmunro.wordpress.com/278/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=poshoholic.com&blog=1436967&post=278&subd=kirkmunro&ref=&feed=1"/></div><img src="http://feeds.feedburner.com/~r/Poshoholic/~4/7XD7ov1G28M" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Cleaning the Temp folder - Scheduling</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2605.entry</link>
         <description>&lt;p&gt;When I posted about cleaning the temp folder &lt;a rel=&quot;nofollow&quot; title=&quot;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/04/cleaning-temp-folder.aspx&quot; target=&quot;_blank&quot; href=&quot;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/04/cleaning-temp-folder.aspx&quot;&gt;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/04/cleaning-temp-folder.aspx&lt;/a&gt; I said I would look at scheduling the task. I had intended to use the TaskScheduler module in the new PowerShell pack which can be downloaded from &lt;a rel=&quot;nofollow&quot; title=&quot;http://code.msdn.microsoft.com/PowerShellPack&quot; target=&quot;_blank&quot; href=&quot;http://code.msdn.microsoft.com/PowerShellPack&quot;&gt;http://code.msdn.microsoft.com/PowerShellPack&lt;/a&gt;. It is also available in the Windows 7 Resource Kit. The pack provides 10 modules for PowerShell 2.0 covering a number of areas:&lt;/p&gt; &lt;p&gt;DotNet &lt;br /&gt;FileSystem &lt;br /&gt;IsePack &lt;br /&gt;PowerShellPack &lt;br /&gt;PSCodeGen &lt;br /&gt;PSImageTools &lt;br /&gt;PSRSS &lt;br /&gt;PSSystemTools &lt;br /&gt;PSUserTools &lt;br /&gt;TaskScheduler &lt;br /&gt;WPK&lt;/p&gt; &lt;p&gt;The modules are installed in WindowsPowerShell&amp;#92;Modules in your profile.&lt;/p&gt; &lt;p&gt;I’ll look at some of the others in future posts but for now I want to concentrate on the Scheduler. The module supplies a number of functions&lt;/p&gt; &lt;p&gt;Add-TaskAction &lt;br /&gt;Add-TaskTrigger &lt;br /&gt;Connect-ToTaskScheduler &lt;br /&gt;Get-RunningTask &lt;br /&gt;Get-ScheduledTask &lt;br /&gt;New-Task &lt;br /&gt;Register-ScheduledTask &lt;br /&gt;Remove-Task &lt;br /&gt;Start-Task &lt;br /&gt;Stop-Task&lt;/p&gt; &lt;p&gt;I had difficulty with the Add-TaskAction and Add-TaskTrigger functions so I ended up experimenting and produced the following script&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:733px;padding-right:5px;font-family:consolas, lucida console;height:495px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001 &lt;br /&gt;002 &lt;br /&gt;003 &lt;br /&gt;004 &lt;br /&gt;005 &lt;br /&gt;006 &lt;br /&gt;007 &lt;br /&gt;008 &lt;br /&gt;009 &lt;br /&gt;010 &lt;br /&gt;011 &lt;br /&gt;012 &lt;br /&gt;013 &lt;br /&gt;014 &lt;br /&gt;015 &lt;br /&gt;016 &lt;br /&gt;017 &lt;br /&gt;018 &lt;br /&gt;019 &lt;br /&gt;020 &lt;br /&gt;021 &lt;br /&gt;022 &lt;br /&gt;023 &lt;br /&gt;024 &lt;br /&gt;025 &lt;br /&gt;026 &lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Import-Module&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;TaskScheduler&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$task&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;New-Task&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$at&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[datetime]&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;1:00 PM&quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## trigger on daily schedule&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$trigger&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$task&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Triggers&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;2&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;$trigger&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;StartBoundary&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$at&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;s&quot;&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;$trigger&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;DaysInterval&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$task&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## run command line operation&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$Action&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$Task&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Actions&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Create&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;0&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;$action&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Join-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$psHome&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;PowerShell.exe&quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$action&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;WorkingDirectory&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$pwd&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$Script&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[ScriptBlock]&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Import-Module&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;FileFunctions&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:#0000ff;&quot;&gt;Remove-TempContents&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;$encodedScriptBlock&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$encodedCommand&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[Convert]&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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:#008080;&quot;&gt;[Text.Encoding]&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Unicode&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;$script&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;$action&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Arguments&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot; -encodedCommand $encodedCommand&quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$task&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$scheduler&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Connect-ToTaskScheduler&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$scheduler&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Connected&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$folder&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$scheduler&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;GetFolder&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## arguments task name, task definition, create task, userid, password, user must be logged in, security descriptor&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$folder&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;RegisterTaskDefinition&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;TempClean&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$task&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$null&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;I imported the TaskScheduler module and used the New-Task function to create a task. I then set the task to run every day at 1:00pm. The action the task performs is to first start PowerShell in the present working directory. Create a script block to run and encode it as shown. The two references to $task show me the contents of the task variable. its worth a look especially the XML.&lt;/p&gt; &lt;p&gt;Connect-TaskScheduler is used to create a variable I can use for scheduling the task.&lt;/p&gt; &lt;p&gt;We can see the scheduled task using&lt;/p&gt; &lt;p&gt;Get-ScheduledTask&lt;/p&gt; &lt;p&gt;We can run the task outside of the scheduled time&lt;/p&gt; &lt;p&gt;PS&amp;gt; Get-ScheduledTask -Name TempClean | Start-Task &lt;/p&gt; &lt;p&gt;Name : TempClean &lt;br /&gt;InstanceGuid : {218CB104-5FBF-4611-B02D-151AA20363C1} &lt;br /&gt;Path : &amp;#92;TempClean &lt;br /&gt;State : &lt;br /&gt;CurrentAction : C:&amp;#92;Windows&amp;#92;System32&amp;#92;WindowsPowerShell&amp;#92;v1.0&amp;#92;PowerShell.exe &lt;br /&gt;EnginePID : 1948 &lt;/p&gt; &lt;p&gt;And we can remove the task&lt;/p&gt; &lt;p&gt;Get-ScheduledTask -Name TempClean | Remove-Task&lt;/p&gt; &lt;p&gt;the task scheduler API is documented on MSDN. &lt;a rel=&quot;nofollow&quot; title=&quot;http://msdn.microsoft.com/en-us/library/aa383614(VS.85).aspx&quot; target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/aa383614(VS.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa383614(VS.85).aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This holds a lot of possibilities including creating tasks on remote machines. Needs more investigation especially why the functions aren’t working for me.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Scheduled+task&quot;&gt;Scheduled task&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerPack&quot;&gt;PowerPack&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Modules&quot;&gt;Modules&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2605</guid>
         <pubDate>Thu, 12 Nov 2009 19:44:46 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>PowerGui.Org’s PowerPack Challenge – Closing Sooon</title>
         <link>http://tfl09.blogspot.com/2009/11/powerguiorgs-powerpack-challenge.html</link>
         <description>&lt;p&gt;PowerGUI.org is holding the PowerPack Challenge contest. Basically,&amp;#160; the idea is that you create a PowerGUI add-on (admin console for a particular platform you manage based on PowerShell cmdlets/scrips), and then submit it to the site. By entering the contest, you can win one of the prizes (the top prizes are $1000 in Amazon certificates). This is easy and the site has tutorials on how to do this. &lt;/p&gt; &lt;p&gt;The contest will run for 3 more days, i.e. until the end of Nov 15 2009. You can get full details at &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.powergui.org&quot;&gt;PowerGUI.Org&lt;/a&gt;. Get coding and best of luck! &lt;br /&gt;&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e7ee0693-d478-4fba-b638-9d86bb83e787&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerGUI&quot;&gt;PowerGUI&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;&lt;/div&gt; &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5384857-723574723016195065?l=tfl09.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Thomas</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5384857.post-723574723016195065</guid>
         <pubDate>Thu, 12 Nov 2009 08:17:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>TechMentor Spring 2010</title>
         <link>http://jdhitsolutions.com/blog/2009/11/techmentor-spring-2010/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
         <description>If you are thinking about what conferences to attend next year, I hope you’ll consider joining me in Orlando for the Spring TechMentor show. The show runs March 8-12, 2010 in sunny Orlando, FL. This is a great show where you can take away a ton of information that you can put to work immediately. [...]&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?a=uxtq1lktusA:pVNMNqsJprg:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?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/JeffsScriptingBlogAndMore?a=uxtq1lktusA:pVNMNqsJprg:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/uxtq1lktusA&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Jeffery Hicks</author>
         <guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/11/techmentor-spring-2010/</guid>
         <pubDate>Thu, 12 Nov 2009 09:41:29 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>SRV312 TechEd Slides</title>
         <link>http://blogs.msdn.com/powershell/archive/2009/11/12/srv312-teched-slides.aspx</link>
         <description>&lt;p&gt;I just gave the talk, &quot;”Server Management Improvements and Solutions for Windows Server 2008 R2”.&amp;nbsp; It went over rather well.&amp;nbsp; Attached are the slides.&amp;nbsp; I will try to get you the demos but that will be difficult and will take some time.&lt;/p&gt;
&lt;p&gt;Enjoy! &lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT] &lt;br&gt;Distinguished Engineer &lt;br&gt;Visit the Windows PowerShell Team blog at:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/PowerShell&quot;&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt; &lt;br&gt;Visit the Windows PowerShell ScriptCenter at:&amp;nbsp; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&quot;&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://blogs.msdn.com/aggbug.aspx?PostID=9921338&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>PowerShellTeam</author>
         <guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9921338</guid>
         <pubDate>Thu, 12 Nov 2009 05:57:00 -0800</pubDate>
         <media:content></media:content>
         <enclosure length="2129641" url="http://blogs.msdn.com/powershell/attachment/9921338.ashx" type="application/vnd.openxmlformats-officedocument.pres"/>
      </item>
      <item>
         <title>3 days left to submit your PowerPack</title>
         <link>http://dmitrysotnikov.wordpress.com/2009/11/12/3-days-left-to-submit-your-powerpack/</link>
         <description>What are you waiting for? Install PowerGUI, watch this video, follow this tutorial, create the PowerPack of your dream and win one of the prizes!
This is really easy, fun, and a great way to have your own IT dreams (and dreams of many IT professionals out there in the community) come true.
The deadline is November [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&amp;blog=867377&amp;post=1631&amp;subd=dmitrysotnikov&amp;ref=&amp;feed=1&quot;/&gt;</description>
         <author>Dmitry Sotnikov</author>
         <guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/2009/11/12/3-days-left-to-sumbit-your-powerpack/</guid>
         <pubDate>Thu, 12 Nov 2009 03:00:57 -0800</pubDate>
         <content:encoded><![CDATA[<div class='snap_preview'><br /><p><a rel="nofollow" target="_blank" href="http://powergui.org/powerpackchallenge.jspa"><img alt="" src="http://powergui.org/jiveHome/themes/powergui/sbin/images/bn-powerGUI-202x160.jpg" title="PowerPack Challenge" class="alignleft" width="202" height="160"/></a>What are you waiting for? Install PowerGUI, watch <a rel="nofollow" target="_blank" href="http://dmitrysotnikov.wordpress.com/2009/10/29/video-on-creating-a-powerpack/">this video</a>, follow <a rel="nofollow" target="_blank" href="http://dmitrysotnikov.wordpress.com/2009/11/10/powerpack-creation-manual/">this tutorial</a>, create the PowerPack of your dream and <a rel="nofollow" target="_blank" href="http://powergui.org/powerpackchallenge.jspa">win one of the prizes</a>!</p>
<p>This is really easy, fun, and a great way to have your own IT dreams (and dreams of many IT professionals out there in the community) come true.</p>
<p>The deadline is November 15. Details can be found <a rel="nofollow" target="_blank" href="http://powergui.org/powerpackchallenge.jspa">here</a>.</p> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1631/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1631/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1631/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1631/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1631/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1631&subd=dmitrysotnikov&ref=&feed=1"/></div>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Extension for temporary files</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2604.entry</link>
         <description>&lt;p&gt;When I did the post on creating temporary files &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/05/creating-temporary-files.aspx&quot;&gt;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/05/creating-temporary-files.aspx&lt;/a&gt; I said I’d modify it so the file would be created with a given extension.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;019&lt;br /&gt;020&lt;br /&gt;021&lt;br /&gt;022&lt;br /&gt;023&lt;br /&gt;024&lt;br /&gt;025&lt;br /&gt;026&lt;br /&gt;027&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## asssume that want temp files in multiples of 1KB or empty&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## renaming Get-ChildItem -Path c:&amp;#92;test&amp;#92;test2 | Rename-Item -NewName {$_.Name -replace &quot;&amp;#92;....&quot;, &quot;.txt&quot;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;New-TempFile&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:#00008b;&quot;&gt;param&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:#008080;&quot;&gt;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;C:&amp;#92;Test&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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;[int]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$size&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1KB&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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;[string]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ext&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&quot;&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:#00008b;&quot;&gt;if&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:#a9a9a9;&quot;&gt;!&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&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;{&lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Invalid path&quot;&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;$file&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[System.IO.Path]&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;GetRandomFileName&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:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$ext&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-ne&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&quot;&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;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$ext&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;StartsWith&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;.&quot;&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;{&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ext&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$ext&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Remove&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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:#ff4500;&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-replace&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;&amp;#92;....&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;.$ext&quot;&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;if&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:#ff4500;&quot;&gt;$size&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;0&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:#0000ff;&quot;&gt;New-Item&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Name&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ItemType&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;'File'&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:#00008b;&quot;&gt;else&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:#ff4500;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;*&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;128&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;$lines&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;[System.Math]&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Ceiling&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:#ff4500;&quot;&gt;$size&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1kb&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:#a9a9a9;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;8&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:#00008b;&quot;&gt;for&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:#ff4500;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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:#ff4500;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-le&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$lines&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:#ff4500;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Add-Content&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Path&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:#0000ff;&quot;&gt;Join-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ChildPath&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$file&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:#000080;&quot;&gt;-Value&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$data&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:#0000ff;&quot;&gt;Get-ChildItem&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$path&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-Filter&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$file&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;It just involves adding another parameter $ext with a default empty string value. If we give an extension &lt;/p&gt; &lt;p&gt;New-TempFile -size 2kb -ext &quot;txt&quot; -path &quot;c:&amp;#92;test&amp;#92;test2&quot; &lt;p&gt;Then we test to see if it starts with a . and remove it. We then replace the extension of the randomly generated filename using a regular expression match on the extension [ the regex is translated as 3 characters following a . The &amp;#92; is an escape character so . is read literally rather than as a wildcard]&lt;/p&gt; &lt;p&gt;Everything else is the same. One other thing I might do is change the way data is put into the files. For larger files its slow so I might do something different there. This is one of great features of working with PowerShell like this – I can get a working script quickly and then refine it over time as I get chance to think about it. Because I can work interactively at the prompt I can quickly test ideas before changing the script.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/functions&quot;&gt;functions&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/modules&quot;&gt;modules&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/temporary&quot;&gt;temporary&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/files&quot;&gt;files&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2604</guid>
         <pubDate>Wed, 11 Nov 2009 19:50:31 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>BSonPosh Module goes Beta (2)</title>
         <link>http://feedproxy.google.com/~r/BsOnPosh/~3/DtbUTPJbUuo/1070</link>
         <description>I released a private beta a little bit back but this is an open beta (and there is a whole bunch more in it.)
How to Install
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; Download: BSonPosh Powershell Module
Extract ZIP to your module folder $Env:PSModulePath. I found it better use the global module path (although it requires admin rights.)
Import-module bsonposh Report bugs (please)
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; via Discussions
via Wave located [...]</description>
         <author>tshell</author>
         <guid isPermaLink="false">http://bsonposh.com/?p=1070</guid>
         <pubDate>Wed, 11 Nov 2009 18:38:39 -0800</pubDate>
         <content:encoded><![CDATA[<p>I released a private beta a little bit back but this is an open beta (and there is a whole bunch more in it.)</p>
<p>How to Install<br />
&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://code.msdn.microsoft.com/bsonposh">BSonPosh Powershell Module</a></li>
<li>Extract ZIP to your module folder $Env:PSModulePath. I found it better use the global module path (although it requires admin rights.)</li>
<li>Import-module bsonposh</li>
</ul>
<p>Report bugs (please)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<ul>
<li>via Discussions</li>
<li>via Wave located here http://bsonposh.com/bug-report-page ( requires Google wave account )</li>
<li>via Contact form http://bsonposh.com/contact-me</li>
</ul>
<p>A little taste of the 88 cmdlets<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<ul>
<li>Get-CPU</li>
<li>Get-DiskSpace</li>
<li>Get-LocalGroupMember</li>
<li>Get-OSVersion</li>
<li>Get-RebootTime</li>
<li>Get-Uptime</li>
<li>Get-WindowsUpdate</li>
<li>Get-SysInternals</li>
<li>Get-Routetable</li>
</ul>
<p>Even added a whole suite of Registry functions<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<ul>
<li>Get-RegistryHive</li>
<li>Get/Set/New-RegistryKey</li>
<li>Get/Set/New-RegistryValue</li>
<li>Remove-RegistryKey</li>
<li>Remove-RegistryValue</li>
<li>Test-RegistryKey</li>
<li>Test-RegistryValue</li>
</ul>
<p>Hope you find use for these and please provide feedback. Thanks!</p>
<div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/BsOnPosh?a=DtbUTPJbUuo:0KGZpgvN0Ik:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/BsOnPosh?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/BsOnPosh?a=DtbUTPJbUuo:0KGZpgvN0Ik:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/BsOnPosh?i=DtbUTPJbUuo:0KGZpgvN0Ik:F7zBnMyn0Lo" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/BsOnPosh?a=DtbUTPJbUuo:0KGZpgvN0Ik:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/BsOnPosh?d=qj6IDK7rITs" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/BsOnPosh?a=DtbUTPJbUuo:0KGZpgvN0Ik:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/BsOnPosh?d=dnMXMwOfBR0" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/BsOnPosh?a=DtbUTPJbUuo:0KGZpgvN0Ik:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/BsOnPosh?i=DtbUTPJbUuo:0KGZpgvN0Ik:V_sGLiPBpWU" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/BsOnPosh/~4/DtbUTPJbUuo" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>PowerShell-Based console for SMS 2003</title>
         <link>http://dmitrysotnikov.wordpress.com/2009/11/11/powershell-based-console-for-sms-2003/</link>
         <description>Are you running Microsoft Systems Management Server 2003 and want to have it fully scriptable in PowerShell?
Check out this wonderful SMS/ConfigMgr PowerPack David Moravec put together.
It lets you browse all your SMS configuration and among other things: List members of collection
See package properties
See programs inside the package
See distribution points where the package is replicated
Refresh package on [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&amp;blog=867377&amp;post=1624&amp;subd=dmitrysotnikov&amp;ref=&amp;feed=1&quot;/&gt;</description>
         <author>Dmitry Sotnikov</author>
         <guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1624</guid>
         <pubDate>Wed, 11 Nov 2009 06:42:38 -0800</pubDate>
         <content:encoded><![CDATA[<div class='snap_preview'><br /><p><a rel="nofollow" target="_blank" href="http://www.powergui.org/entry.jspa?externalID=2562&amp;categoryID=296"><img class="alignleft" title="SMS 2003 PowerPack left-hand tree" src="http://www.powergui.org/servlet/KbServlet/downloadImage/2562-102-245/tree.jpg" alt="" width="261" height="321"/></a>Are you running Microsoft Systems Management Server 2003 and want to have it fully scriptable in PowerShell?</p>
<p>Check out this wonderful <a rel="nofollow" target="_blank" href="http://powergui.org/entry.jspa?externalID=2562&amp;categoryID=296">SMS/ConfigMgr PowerPack</a> <a rel="nofollow" target="_blank" href="http://twitter.com/makovec">David Moravec</a> put together.</p>
<p>It lets you browse all your SMS configuration and among other things:</p>
<ul>
<li>List members of collection</li>
<li>See package properties</li>
<li>See programs inside the package</li>
<li>See distribution points where the package is replicated</li>
<li>Refresh package on distribution points</li>
<li>See advertisements assigned to colection</li>
<li>See your site structure in dynamic nodes (as tree)</li>
<li>Reports listed by specific categories</li>
<li>Go to some predefined web pages (e.g. myITforum.com)</li>
<li>See overall health of your site</li>
</ul>
<p>And as always with PowerPacks &#8211; this one shows all the PowerShell code behind it, lets you customize and tweak it, gives bulk operations, filtering, reporting aand so on!</p>
<p>Download the pack from <a rel="nofollow" target="_blank" href="http://powergui.org/entry.jspa?externalID=2562&amp;categoryID=296">here</a> and let David know what you think!</p>
<p>Are you also into PowerShell and have a great idea of a tool to make someone’s life easier? Go for it – <a rel="nofollow">create your PowerPack and submit it to the contest</a>!</p> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1624/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1624&subd=dmitrysotnikov&ref=&feed=1"/></div>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Hey, Scripting Guy! Can I Change on the Fly the Way Windows PowerShell Functions Work?</title>
         <link>http://blogs.technet.com/heyscriptingguy/archive/2009/11/11/hey-scripting-guy-can-i-change-on-the-fly-the-way-windows-powershell-functions-work.aspx</link>
         <description>Hey, Scripting Guy! I have started using functions in Windows PowerShell to encapsulate complex commands, and it works pretty well. However, I would like to be able to change the way the functions work on the fly. By this I do not mean that I will throw...(&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/heyscriptingguy/archive/2009/11/11/hey-scripting-guy-can-i-change-on-the-fly-the-way-windows-powershell-functions-work.aspx&quot;&gt;read more&lt;/a&gt;)&lt;img src=&quot;http://blogs.technet.com/aggbug.aspx?PostID=3292166&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>ScriptingGuy</author>
         <guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3292166</guid>
         <pubDate>Wed, 11 Nov 2009 00:01:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Security Essentials</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2603.entry</link>
         <description>&lt;p&gt; &lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;016&lt;br /&gt;017&lt;br /&gt;018&lt;br /&gt;019&lt;br /&gt;020&lt;br /&gt;021&lt;br /&gt;022&lt;br /&gt;023&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#006400;&quot;&gt;#Requires -version 2.0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## wrapper functions for Microsoft Security Essentials&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$mse&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;C:&amp;#92;Program Files&amp;#92;Microsoft Security Essentials&amp;#92;MpCmdRun.exe&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;Start-Scan&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:#00008b;&quot;&gt;param&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:#008080;&quot;&gt;[int]&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$type&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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:#00008b;&quot;&gt;switch&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:#ff4500;&quot;&gt;$type&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:#800080;&quot;&gt;0&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; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Write-Host&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Starting Scan based on configuration&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$mse&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-scan&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-scantype&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&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:#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:#800080;&quot;&gt;1&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; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Write-Host&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Starting Quick Scan&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$mse&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-scan&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-scantype&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&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:#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:#800080;&quot;&gt;2&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; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Write-Host&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Starting Full Scan&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$mse&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-scan&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-scantype&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&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:#000000;&quot;&gt;}&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:#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;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;During my enforced break from posting in September &amp;amp; October PowerShell v2 was released for down level systems including Vista, Windows 2008, Windows 2003 and XP. I’ve set up an XP machine to try it on and needed some AV. Not having licenses left for AVG which is my current AV product I decided to try Microsoft Security Essentials as well (its free which is always a good point for test machines)&lt;/p&gt; &lt;p&gt;Security Essentials comes with a command line tool – but its not PowerShell. I can get two wins here by creating a module that wraps the mpcmdrun tool in PowerShell. It is also a good example of how to run a legacy command line tool within PowerShell and pass parameters to it.&lt;/p&gt; &lt;p&gt;This function is the start – need to perform a scan – its easier to remember start-scan than the syntax of mpcmdrun. I’ll can refine this by testing the range of the parameter and adding more functions.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell+v2&quot;&gt;PowerShell v2&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/XP&quot;&gt;XP&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Microsoft+Security+Essentials&quot;&gt;Microsoft Security Essentials&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2603</guid>
         <pubDate>Tue, 10 Nov 2009 11:24:14 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>PowerPack Creation Manual</title>
         <link>http://dmitrysotnikov.wordpress.com/2009/11/10/powerpack-creation-manual/</link>
         <description>Kirk has published a pretty extensive reference manual on PowerPacks (PowerGUI add-ons), what they are, how to customize them, and how to create the ones of your own.
Great timing considering that you still have 5 days to create a PowerPack and submit it to the PowerPack Challenge!
Check out the document here. [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&amp;blog=867377&amp;post=1626&amp;subd=dmitrysotnikov&amp;ref=&amp;feed=1&quot;/&gt;</description>
         <author>Dmitry Sotnikov</author>
         <guid isPermaLink="false">http://dmitrysotnikov.wordpress.com/?p=1626</guid>
         <pubDate>Tue, 10 Nov 2009 03:03:07 -0800</pubDate>
         <content:encoded><![CDATA[<div class='snap_preview'><br /><p><a rel="nofollow" target="_blank" href="http://poshoholic.com">Kirk</a> has published a pretty extensive <a rel="nofollow" target="_blank" href="http://wiki.powergui.org/index.php/PowerPacks">reference manual on PowerPacks</a> (PowerGUI add-ons), what they are, how to customize them, and how to create the ones of your own.</p>
<p>Great timing considering that you still have 5 days to create a PowerPack and submit it to the <a rel="nofollow" target="_blank" href="http://dmitrysotnikov.wordpress.com/2009/10/23/powerpack-challenge-2009-begins/">PowerPack Challenge</a>!</p>
<p>Check out the document <a rel="nofollow" target="_blank" href="http://wiki.powergui.org/index.php/PowerPacks">here</a>.</p> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/dmitrysotnikov.wordpress.com/1626/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmitrysotnikov.wordpress.com/1626/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/dmitrysotnikov.wordpress.com/1626/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmitrysotnikov.wordpress.com/1626/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/dmitrysotnikov.wordpress.com/1626/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmitrysotnikov.wordpress.com/1626/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/dmitrysotnikov.wordpress.com/1626/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmitrysotnikov.wordpress.com/1626/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/dmitrysotnikov.wordpress.com/1626/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmitrysotnikov.wordpress.com/1626/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmitrysotnikov.wordpress.com&blog=867377&post=1626&subd=dmitrysotnikov&ref=&feed=1"/></div>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Hey, Scripting Guy! How Can I Create a Custom Function?</title>
         <link>http://blogs.technet.com/heyscriptingguy/archive/2009/11/10/hey-scripting-guy-how-can-i-create-a-custom-function.aspx</link>
         <description>Hey, Scripting Guy! I am getting tired of typing the long commands used in Windows PowerShell. I know you Scripting Guys seem to show people always typing commands inside the Windows PowerShell console, but I do not think I like to work that way. It is...(&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/heyscriptingguy/archive/2009/11/10/hey-scripting-guy-how-can-i-create-a-custom-function.aspx&quot;&gt;read more&lt;/a&gt;)&lt;img src=&quot;http://blogs.technet.com/aggbug.aspx?PostID=3292117&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>ScriptingGuy</author>
         <guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3292117</guid>
         <pubDate>Tue, 10 Nov 2009 00:01:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Getting Change Events</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2602.entry</link>
         <description>&lt;p&gt;I wasn’t particularly happy with the script for getting change events on the filesystemwatcher we discussed last time. As a quick recap we ended up with this&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System Changed&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;where&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;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;EventIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;2&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:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#8b0000;&quot;&gt;&quot;{0}, {1}, {2}&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-f&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceEventArgs&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;FullPath&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TimeGenerated&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:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Which depends on the correct identification of the order in which events are issued. That seemed like too much manual intervention. It was too late last night to solve so I had another look today and came up with this&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:820px;padding-right:5px;font-family:consolas, lucida console;height:75px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System Changed&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Group&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;TimeGenerated&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;where&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:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Count&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;2&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:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#ff4500;&quot;&gt;$time&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Name&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:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;where&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:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TimeGenerated&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ToString&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; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$time&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-First&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;use get-event with the correct source identifier. We then group on timegenerated. File Changes will generate two change records per event so we select where the count is 2. Pass those into a foreach and retrieve the events matching that time. We select the first one of each pair to only access a single record. One neat line of PowerShell does it all.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/PowerShell&quot;&gt;PowerShell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/events&quot;&gt;events&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/filesystemwatcher&quot;&gt;filesystemwatcher&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/change&quot;&gt;change&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2602</guid>
         <pubDate>Mon, 09 Nov 2009 20:03:20 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>He Gets Around!</title>
         <link>http://feedproxy.google.com/~r/SapienBlog/~3/UF-RSMz2fAI/</link>
         <description>CEO Ferdinand Rios is off to Columbus Ohio to speak at The Central Ohio PowerShell user group on 11/12/2009 at 6:30pm.
Location:
1275 Kinnear Road
Columbus, OH&amp;#160; 43212
phone: 614-675-3711
They will be discussing PowerShell Profiles.&amp;#160; Dr. Rios will be presenting PrimalForms and how to create GUI interfaces in PowerShell. If you are in the area come on by! For [...]</description>
         <author>Margaret Pratt</author>
         <guid isPermaLink="false">http://blog.sapien.com/index.php/2009/11/09/he-gets-around/</guid>
         <pubDate>Mon, 09 Nov 2009 11:32:00 -0800</pubDate>
         <content:encoded><![CDATA[<p>CEO Ferdinand Rios is off to Columbus Ohio to speak at The Central Ohio PowerShell user group on 11/12/2009 at 6:30pm.</p>
<p>Location:</p>
<p>1275 Kinnear Road</p>
<p>Columbus, OH&#160; 43212</p>
<p>phone: 614-675-3711</p>
<p>They will be discussing PowerShell Profiles.&#160; Dr. Rios will be presenting PrimalForms and how to create GUI interfaces in PowerShell. </p>
<p>If you are in the area come on by! For more information please visit <a rel="nofollow" title="http://centralohiopug.wordpress.com/2009/11/04/reminder-november-powershell-users-group/" target="_blank" href="http://centralohiopug.wordpress.com/2009/11/04/reminder-november-powershell-users-group/">http://centralohiopug.wordpress.com/2009/11/04/reminder-november-powershell-users-group/</a></p> <span class="slashdigglicious">
<a rel="nofollow" target="_blank" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F&amp;title=He+Gets+Around%21" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]"/></a>
<a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F&amp;title=He+Gets+Around%21" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]"/></a>
<a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F&amp;title=He+Gets+Around%21" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]"/></a>
<a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F&amp;title=He+Gets+Around%21" title="Save to del.icio.us"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]"/></a>
<a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]"/></a>
<a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]"/></a>
<a rel="nofollow" target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F&amp;title=He+Gets+Around%21" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]"/></a>
<a rel="nofollow" target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.sapien.com%2Findex.php%2F2009%2F11%2F09%2Fhe-gets-around%2F&amp;title=He+Gets+Around%21" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]"/></a>
</span>
 <p class='technorati-tags'>Technorati Tags: <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/Events'>Events</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/General'>General</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/PrimalForm'>PrimalForm</a>, <a rel="nofollow" class='technorati-link' target="_blank" href='http://technorati.com/tag/Windows+PowerShell'>Windows PowerShell</a></p> 
<div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=UF-RSMz2fAI:Qsn1EEaT9f4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=UF-RSMz2fAI:Qsn1EEaT9f4:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=I9og5sOYxJI" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=UF-RSMz2fAI:Qsn1EEaT9f4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=7Q72WNTAKBA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/SapienBlog?a=UF-RSMz2fAI:Qsn1EEaT9f4:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/SapienBlog?d=nQ_hWtDbxek" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/SapienBlog/~4/UF-RSMz2fAI" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Watching the file system</title>
         <link>http://richardsiddaway.spaces.live.com/Blog/cns!43CFA46A74CF3E96!2601.entry</link>
         <description>&lt;p&gt;We saw how to watch for WMI events &lt;a rel=&quot;nofollow&quot; title=&quot;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/07/powershell-wmi-events.aspx&quot; target=&quot;_blank&quot; href=&quot;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/07/powershell-wmi-events.aspx&quot;&gt;http://msmvps.com/blogs/richardsiddaway/archive/2009/11/07/powershell-wmi-events.aspx&lt;/a&gt;. In this post we will look at watching the file system. This time we will use the .NET System.IO.FileSystemWatcher object which means we use Register-ObjectEvent instead of Register-WmiEvent.&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;005&lt;br /&gt;006&lt;br /&gt;007&lt;br /&gt;008&lt;br /&gt;009&lt;br /&gt;010&lt;br /&gt;011&lt;br /&gt;012&lt;br /&gt;013&lt;br /&gt;014&lt;br /&gt;015&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## folder to watch&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$folder&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;C:&amp;#92;test&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## watch all files&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$filter&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;*&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## events to watch&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$events&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&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:#8b0000;&quot;&gt;&quot;Changed&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Created&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Deleted&quot;&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;Renamed&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## create watcher&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$fsw&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#000000;&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; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-TypeName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8a2be2;&quot;&gt;System.IO.FileSystemWatcher&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-ArgumentList&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$folder&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$filter&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$fsw&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;IncludeSubDirectories&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;=&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;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006400;&quot;&gt;## register events&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;foreach&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:#ff4500;&quot;&gt;$event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#00008b;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$events&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:#0000ff;&quot;&gt;Register-ObjectEvent&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-InputObject&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$fsw&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-EventName&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System $event&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;We can start by defining the folder we want to watch and which files. In this case I want to watch all files. We can restrict it to certain files e.g. $filter = “*.txt”&lt;/p&gt; &lt;p&gt;Wildcards work in the normal way for this filter. We could even restrict to a single file. The events we are interested in are defined.&lt;/p&gt; &lt;p&gt;After creating a System.IO.FileSystemWatcher object using the folder and filter in the construction we set the IncludeSubDirectories property so we are watching the whole path.&lt;/p&gt; &lt;p&gt;Finally we need to register an event for each event we are interested in. Notice how the SourceIdentifier changes to identify the particular event.&lt;/p&gt; &lt;p&gt;We can see the Eventsubscribers we have created.&lt;/p&gt; &lt;p&gt;PS&amp;gt; &lt;font color=&quot;#0000ff&quot;&gt;&lt;strong&gt;Get-EventSubscriber | Select SubscriptionId, EventName, SourceIdentifier | ft -a&lt;/strong&gt; &lt;/font&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;SubscriptionId EventName SourceIdentifier&lt;br /&gt;-------------- --------- ----------------&lt;br /&gt; 3 Changed File System Changed&lt;br /&gt; 4 Created File System Created&lt;br /&gt; 5 Deleted File System Deleted&lt;br /&gt; 6 Renamed File System Renamed&lt;/font&gt; &lt;p&gt;We now need to perform some actions on the files – create, change, rename, delete that we are monitoring&lt;/p&gt; &lt;p&gt;PS&amp;gt; &lt;strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;Get-Event | group SourceIdentifier&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt;Count Name Group&lt;br /&gt;----- ---- -----&lt;br /&gt; 7 File System Changed {System.Management.Automation.PSEventArgs, System.Management.Automation.PSEventArgs,...&lt;br /&gt; 1 File System Renamed {System.Management.Automation.PSEventArgs}&lt;br /&gt; 1 File System Created {System.Management.Automation.PSEventArgs}&lt;br /&gt; 1 File System Deleted {System.Management.Automation.PSEventArgs}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;If we look at this in more detail &lt;p&gt;PS&amp;gt; &lt;strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;Get-Event | select EventIdentifier, SourceIdentifier, TimeGenerated&lt;/font&gt;&lt;/strong&gt; &lt;p&gt;&lt;font face=&quot;Courier New&quot;&gt; EventIdentifier SourceIdentifier TimeGenerated&lt;br /&gt; --------------- ---------------- -------------&lt;br /&gt; 1 File System Changed 08/11/2009 11:46:39&lt;br /&gt; 2 File System Changed 08/11/2009 11:46:39&lt;br /&gt; 3 File System Renamed 08/11/2009 11:49:53&lt;br /&gt; 4 File System Changed 08/11/2009 11:49:53&lt;br /&gt; 5 File System Created 08/11/2009 11:53:18&lt;br /&gt; 6 File System Changed 08/11/2009 11:53:18&lt;br /&gt; 7 File System Changed 08/11/2009 11:53:31&lt;br /&gt; 8 File System Changed 08/11/2009 11:53:31&lt;br /&gt; 9 File System Deleted 08/11/2009 11:54:22&lt;br /&gt; 10 File System Changed 08/11/2009 11:54:22&lt;/font&gt; &lt;p&gt; &lt;p&gt;Note that we get pairs of events – the second event of the pair is always a change event. If we just want to see the changes (and remove duplicates). Just be careful on this and check whether its the odd or even record you need if running multiple registered events. &lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:768px;padding-right:5px;font-family:consolas, lucida console;height:109px;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System Changed&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;where&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;(&lt;/span&gt;&lt;span style=&quot;color:#ff4500;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;EventIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;2&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:#a9a9a9;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#800080;&quot;&gt;1&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:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#8b0000;&quot;&gt;&quot;{0}, {1}, {2}&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-f&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceEventArgs&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;FullPath&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TimeGenerated&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:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;We can use Get-Event to pull the change events from the queue. The modulo arithmetic on the EventIdentifier ensures that we only get the first change record. We can then dump the file path and time of change.&lt;/p&gt; &lt;p&gt;In a similar way we can interrogate the other events&lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System Created&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#8b0000;&quot;&gt;&quot;{0}, {1}, {2}&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-f&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceEventArgs&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;FullPath&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TimeGenerated&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:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; width=&quot;2&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System Renamed&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#8b0000;&quot;&gt;&quot;{0}, {1}, {2}, {3}&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-f&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceEventArgs&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;OldFullPath&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceEventArgs&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;FullPath&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TimeGenerated&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:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;div style=&quot;border-bottom:black 1px solid;border-left:black 1px solid;padding-bottom:5px;padding-left:5px;width:750px;padding-right:5px;font-family:consolas, lucida console;font-size:10pt;overflow:auto;border-top:black 1px solid;border-right:black 1px solid;padding-top:5px;&quot;&gt; &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#cecece;font-size:10pt;padding-top:5px;&quot;&gt;001&lt;br /&gt;002&lt;br /&gt;003&lt;br /&gt;004&lt;br /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt; &lt;div style=&quot;padding-bottom:5px;padding-left:5px;padding-right:5px;font-family:consolas, lucida console;background:#fcfcfc;font-size:10pt;padding-top:5px;&quot;&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;Get-Event&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#000080;&quot;&gt;-SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#8b0000;&quot;&gt;&quot;File System Deleted&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;foreach&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:#8b0000;&quot;&gt;&quot;{0}, {1}, {2}&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;-f&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceIdentifier&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;SourceEventArgs&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;FullPath&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;,&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:#a9a9a9;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;TimeGenerated&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:#000000;&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;These four could be combined into a single script if required.&lt;/p&gt; &lt;p&gt;Combined with the process tracing we did previously we can now track what programs are started on a system and what files are accessed.&lt;/p&gt; &lt;div style=&quot;padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;&quot;&gt;Technorati Tags: &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/Powershell&quot;&gt;Powershell&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/events&quot;&gt;events&lt;/a&gt;,&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://technorati.com/tags/files&quot;&gt;files&lt;/a&gt;&lt;/div&gt;</description>
         <guid isPermaLink="false">43CFA46A74CF3E96!2601</guid>
         <pubDate>Mon, 09 Nov 2009 08:14:40 -0800</pubDate>
         <media:content></media:content>
         <category>PowerShell V2</category>
      </item>
      <item>
         <title>Windows Server 2008 R2 Rocks!</title>
         <link>http://blogs.msdn.com/powershell/archive/2009/11/09/windows-server-2008-r2-rocks.aspx</link>
         <description>&lt;p&gt;One of the things I like to say is that, “Microsoft is incapable of sustained error”.&amp;#160; By that I mean that Microsoft is an intensely self-conscious culture, fearless about confronting shortcomings and&amp;#160; constantly looking for ways to do things better.&amp;#160; We beat ourselves up pretty brutally about the shortcomings of Vista and committed ourselves to doing better going forward.&amp;#160; This is one of the reasons why Windows Server 2008 was such a good release.&amp;#160; We didn’t stop there, we raised the bar for Windows 7 and Windows Server 2008 R2.&lt;/p&gt; &lt;p&gt;Part of that was the product itself.&amp;#160; Anyone that uses either of these products can see that immediately.&amp;#160; These are solid, high quality products.&amp;#160; We also raised the bar and teaching people about the release.&amp;#160; &lt;/p&gt; &lt;p&gt;This morning, MSDN’s Channel9 opened up a new site for learning about WS08/R2 &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/&quot;&gt;HERE&lt;/a&gt;.&amp;#160; This site has lessons and short training videos for the following WS08/R2 topics:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Designed for Performance&lt;/li&gt; &lt;li&gt;Designed for Efficiency&lt;/li&gt; &lt;li&gt;Server Core .NET Application Server&lt;/li&gt; &lt;li&gt;The Extensible Web Platform&lt;/li&gt; &lt;li&gt;Extreme Web Services&lt;/li&gt; &lt;li&gt;The Extensible File Classification Infrastructure&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/&quot;&gt;Windows PowerShell is Powerful Automation!&lt;/a&gt;&lt;/li&gt; &lt;ul&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/PowerShellV2forDevelopers/&quot;&gt;Powershell V2 for Developers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/PowerShell/&quot;&gt;Windows PowerShell is Powerful Automation!&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell2/&quot;&gt;Variables, Types, and Operators&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell3/&quot;&gt;Array’s Conditionals, Collections, and Loops&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell4/&quot;&gt;Create Object Cmdlets&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell5/&quot;&gt;Remote Sessions&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/VPowerShell6&quot;&gt;Advanced Remote Sessions&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;li&gt;VHD and Hyper-V APIs Enable Creative New Solutions&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Much of this content if focused on developers but admin/It Pro scripters will find PowerShell section useful and appropriate.&lt;/p&gt; &lt;p&gt;Experiment!&amp;#160; Enjoy!&amp;#160; Engage! &lt;/p&gt; &lt;p&gt;Jeffrey Snover [MSFT] &lt;br /&gt;Distinguished Engineer &lt;br /&gt;Visit the Windows PowerShell Team blog at:&amp;#160;&amp;#160;&amp;#160; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/PowerShell&quot;&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt; &lt;br /&gt;Visit the Windows PowerShell ScriptCenter at:&amp;#160; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&quot;&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://blogs.msdn.com/aggbug.aspx?PostID=9919585&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>PowerShellTeam</author>
         <guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9919585</guid>
         <pubDate>Mon, 09 Nov 2009 08:05:15 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Pre-Orders for Windows PowerShell 2.0: TFM</title>
         <link>http://jdhitsolutions.com/blog/2009/11/pre-orders-for-windows-powershell-2-0-tfm/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
         <description>SAPIEN Press is now taking pre-orders for the latest edition of the popular Windows PowerShell: TFM. The new version, Windows PowerShell 2.0: TFM is really the 3rd edition of our original book. Don Jones and I have worked very hard to make this the most comprehensive PowerShell resource you can have on your book [...]&lt;div class=&quot;feedflare&quot;&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?a=tYQPnauPYLI:_h92EnXmMJs:yIl2AUoC8zA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?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/JeffsScriptingBlogAndMore?a=tYQPnauPYLI:_h92EnXmMJs:7Q72WNTAKBA&quot;&gt;&lt;img src=&quot;http://feeds.feedburner.com/~ff/JeffsScriptingBlogAndMore?d=7Q72WNTAKBA&quot; border=&quot;0&quot;&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/JeffsScriptingBlogAndMore/~4/tYQPnauPYLI&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>Jeffery Hicks</author>
         <guid isPermaLink="false">http://jdhitsolutions.com/blog/2009/11/pre-orders-for-windows-powershell-2-0-tfm/</guid>
         <pubDate>Mon, 09 Nov 2009 06:41:19 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Hey, Scripting Guy! Tell Me About Aliases in Windows PowerShell</title>
         <link>http://blogs.technet.com/heyscriptingguy/archive/2009/11/09/hey-scripting-guy-tell-me-about-aliases-in-windows-powershell.aspx</link>
         <description>Hey, Scripting Guy! I have been playing around with Windows PowerShell 2.0 in Windows 7 and I think that I like it. However, it seems to require an awful lot of typing. The double command names, such as Get-Process , are somewhat helpful for remembering...(&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blogs.technet.com/heyscriptingguy/archive/2009/11/09/hey-scripting-guy-tell-me-about-aliases-in-windows-powershell.aspx&quot;&gt;read more&lt;/a&gt;)&lt;img src=&quot;http://blogs.technet.com/aggbug.aspx?PostID=3291874&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</description>
         <author>ScriptingGuy</author>
         <guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3291874</guid>
         <pubDate>Mon, 09 Nov 2009 00:01:00 -0800</pubDate>
         <media:content></media:content>
      </item>
      <item>
         <title>Twitter in your console prompt: using PS Jobs for background work (Update)</title>
         <link>http://feedproxy.google.com/~r/HuddledMasses/~3/5sFkS-hdmzA/</link>
         <description>Some of you may realize I&amp;#8217;m a bit of an odd personality: when I get an idea, I don&amp;#8217;t want to let it go until I at least prove it&amp;#8217;s possible &amp;#8230; but then I have a tendency to abandon things or leave them for others to finish. Having said all that: here&amp;#8217;s my latest [...]</description>
         <author>Joel 'Jaykul' Bennett</author>
         <guid isPermaLink="false">http://huddledmasses.org/?p=1294</guid>
         <pubDate>Sun, 08 Nov 2009 21:28:53 -0800</pubDate>
         <content:encoded><![CDATA[<p>Some of you may realize I&#8217;m a bit of an odd personality: when I get an idea, I don&#8217;t want to let it go until I at least prove it&#8217;s possible &#8230; but then I have a tendency to abandon things or leave them for others to finish. Having said all that: here&#8217;s my latest one-off script module. I&#8217;m <em>probably</em> done playing with it, and it&#8217;s <em>definitely</em> not a finished, release-quality project &#8230; but it works, it does something neat, and maybe you could learn something from it.</p> <p>Dave Winer was blogging about wanting a <a rel="nofollow" target="_blank" href="http://www.scripting.com/stories/2009/11/06/twitterNeedsACommandline.html">web-based command-line app for twitter</a>, and although I&#8217;m not a big fan of web apps, it <strong>did</strong> make me thing about how it would be interesting to have a command-line twitter application&#8230;</p> <p>So, I grabbed a TwitterLib.dll from <a rel="nofollow" target="_blank" href="http://code.google.com/p/wittytwitter/">Witty</a>, which in turn depends on <a rel="nofollow" target="_blank" href="http://code.google.com/p/tweetsharp/">TweetSharp</a> &#8230; stuffed all of those into a new folder &#8220;Twitter&#8221; inside my Documents&#92;WindowsPowerShell&#92;Modules, and started experimenting in the console:</p> <div class="posh code posh" style="font-family:monospace;"><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>Reflection.<span style="color:#003366;">Assembly</span><span style="color:#333;">&#93;</span></span>::<span style="color:#003366;">LoadFrom</span><span style="color:#333;">&#40;</span> <span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">resolve-<span style="font-style:normal;">path</span></span> <span style="color:#009900;">".&#92;TwitterLib.dll"</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#41;</span><br />
<span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Constructor</span></span> TwitterLib.<span style="color:#003366;">TwitterNet</span><br />
<span style="color:#666666;font-style:italic;"># I see a constructor that takes a string user name and a SecureString password, so I'll need:</span><br />
<span style="color:#660033;font-weight:bold;">$twitterCred</span> &nbsp;<span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Credential</span></span><br />
<span style="color:#660033;font-weight:bold;">$twitter</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Object</span></span> TwitterLib.<span style="color:#003366;">TwitterNet</span> <span style="color:#660033;font-weight:bold;">$twitterCred</span>.<span style="color:#003366;">UserName</span>.<span style="color:#003366;">TrimStart</span><span style="color:#333;">&#40;</span><span style="color:#009900;">"&#92;"</span><span style="color:#333;">&#41;</span>, <span style="color:#660033;font-weight:bold;">$twitterCred</span>.<span style="color:#003366;">Password</span><br />
<span style="color:#660033;font-weight:bold;">$twitter</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Member</span></span><br />
<span style="color:#666666;font-style:italic;"># There's quite a few neat things there, let's try:</span><br />
<span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">GetFriendsTimeline</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#41;</span><br />
&nbsp;</div> <p>Incidentally, I&#8217;m using <a rel="nofollow" target="_blank" href="http://poshcode.org/1368">Get-Constructor</a> (it&#8217;s on PoshCode) to enumerate the constructors, and the output of that <code>GetFriendsTimeline</code> method was <strong>really</strong> verbose. Way more information than I wanted, but, it did have the information I needed.</p> <p>Now, what I wanted was to have the most recent tweets show up as part of my prompt, but I couldn&#8217;t be waiting around while it fetched it every time, so the next thing I did was write a little <code>Start-Job</code> script to run that stuff in a background thread, where I could just <code>Receive-Job</code> to get the data when I was ready for it. I also had to implement something to make sure I wasn&#8217;t going to get the same tweets over and over again (multiple calls to GetFriendsTimeline() return the most recent 20 tweets or so, without regard for whether you&#8217;ve seen them or not):</p> <div class="posh code posh" style="font-family:monospace;"><br />
<span style="color:#0066cc;font-style:italic;">Start-<span style="font-style:normal;">Job</span></span> <span style="color:#000066;">-Name</span> <span style="color:#009900;">"Twitter"</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$twitterCred</span>, <span style="color:#660033;font-weight:bold;">$assemblyPath</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>Reflection.<span style="color:#003366;">Assembly</span><span style="color:#333;">&#93;</span></span>::<span style="color:#003366;">LoadFrom</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$assemblyPath</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$twitter</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Object</span></span> TwitterLib.<span style="color:#003366;">TwitterNet</span> <span style="color:#660033;font-weight:bold;">$twitterCred</span>.<span style="color:#003366;">UserName</span>.<span style="color:#003366;">TrimStart</span><span style="color:#333;">&#40;</span><span style="color:#009900;">"&#92;"</span><span style="color:#333;">&#41;</span>, <span style="color:#660033;font-weight:bold;">$twitterCred</span>.<span style="color:#003366;">Password</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">while</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">GetFriendsTimeline</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">tee</span> <span style="color:#000066;">-var</span> cache <span style="color:#66cc66;">|</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;">where</span> <span style="color:#333;">&#123;</span> <span style="color:#66cc66;">!</span><span style="color:#660033;font-weight:bold;">$cache</span> <span style="color:#000066;">-or</span> <span style="color:#660033;font-weight:bold;">$_</span>.<span style="color:#003366;">id</span> <span style="color:#000066;">-gt</span> <span style="color:#660033;font-weight:bold;">$cache</span><span style="color:#333;">&#91;</span><span style="color:#cc66cc;">0</span><span style="color:#333;">&#93;</span>.<span style="color:#003366;">Id</span> <span style="color:#333;">&#125;</span> <span style="color:#66cc66;">|</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;">ft</span> id, @<span style="color:#333;">&#123;</span>n<span style="color:#66cc66;">=</span><span style="color:#009900;">"ScreenName"</span>;e<span style="color:#66cc66;">=</span><span style="color:#333;">&#123;</span><span style="color:#660033;font-weight:bold;">$_</span>.<span style="color:#003366;">User</span>.<span style="color:#003366;">ScreenName</span><span style="color:#333;">&#125;</span><span style="color:#333;">&#125;</span>, text <span style="color:#000066;">-wrap</span> <span style="color:#000066;">-auto</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">out-<span style="font-style:normal;">string</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;">sleep</span> <span style="color:#cc66cc;">45</span> <span style="color:#666666;font-style:italic;"># or else you start getting rejected</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span> <span style="color:#000066;">-Arg</span> <span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Credential</span></span><span style="color:#333;">&#41;</span>, <span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">resolve-<span style="font-style:normal;">path</span></span> <span style="color:#009900;">".&#92;TwitterLib.dll"</span><span style="color:#333;">&#41;</span><br />
&nbsp;</div> <p>With that done, I can easily fetch all the tweets since the last time I fetched them by just calling <code>Receive-Job Twitter</code>. The one thing you&#8217;ll notice in that is that I had to add a Hash in the Format-Table to get the &#8220;ScreenName&#8221; property to equal the users actual ScreenName. The reason for that is that the TwitterLib.TwitterUser class isn&#8217;t properly serializable &#8212; so when I tried doing the Format-Table stuff on the receiving end, I was getting &#8220;TwitterLib.TwitterUser&#8221; as the value for the User property when I did <code>Receive-Job</code> later. To fix it, I extracted the information I wanted into a string property while the class was still in the &#8220;remote&#8221; runspace &#8212;thus it would serialize easier &#8212; at first I did it just the way it&#8217;s written there, but eventually I realized I should still return the actual object, so I changed it to use <code>Add-Member</code>.</p> <p>In the end, the module I&#8217;ll release is somewhat more complete: it includes a few functions for tweeting and replying and following and even unfollowing, and I wrote a Format file to hide the extra data, and added my own <span class="caps">URL</span> un-shortener to resolve long URLs for display. If I was going to use this full time, I would need to get some support for creating a search that would be permanent too (ie: so I could pull in anything &#8220;public&#8221; about PowerShell &#8212; I think I&#8217;d probably try using the new Bing twitter interface for that.</p> <p>If anyone wants to play with it, I&#8217;ve put it up here <a rel="nofollow" target="_blank" href="http://huddledmasses.org/downloads/PoshTweet.zip">for download [new: 11/9/2009]</a>, and you&#8217;re welcome to use it however you like. I actually tweaked the source code to the Witty TwittlerLib a bit (I&#8217;ll make that available shortly), adding methods for removing friends, and for getting a user by their username instead of by their ID. I also happened to notice, while I was mucking around in the source, there&#8217;s already support in TwitterLib and TweetSharp for several cool things:</p> <ul> <li>Posting an image via a service using a System.IO.FileInfo (this is what PowerShell returns from <code>Get-ChildItem</code> (aka: dir or ls), so it&#8217;s trivial to implement).</li> <li>OAuth from the desktop app (this is a little complicated, but since you can cache it, it would let you avoid asking for the password the way I do right now).</li> </ul> <ul> <li>Search using Twitter&#8217;s <span class="caps">API</span> (I suspect Bing&#8217;s search is rather better, even without real-time <span class="caps">AJAX</span> results).</li> </ul> <h3><span class="caps">UPDATE</span> [11/9/09]</h3> <p>Ok, I polished this up a little more while I was using it, and ended up with a pretty nice client &#8212; it uses <a rel="nofollow" target="_blank" href="http://growlforwindows.com/">Growl for Windows</a> to pop up notices (if it&#8217;s available), and resolves shortened urls, and it now caches better, and has functions for searching/filtering that cache, and opening links from posts, etc. That is &#8230; it&#8217;s basically usable as a client now <img src='http://huddledmasses.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'/> . The download includes those two dependent modules, but not <a rel="nofollow" target="_blank" href="http://growlforwindows.com/">Growl for Windows</a>. </p> <p>I also renamed it, after I finally remembered where I had heard <a rel="nofollow" target="_blank" href="http://twitter.com/powertwitter">PowerTwitter</a> before. I&#8217;ve registered &#8220;PoshTweet&#8221; with twitter as an app name to make sure it was unique, so maybe I&#8217;ll add OAuth support just so it can show up property and advertise itself. <img src='http://huddledmasses.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'/> </p> <p>
<a rel="nofollow" target="_blank" href='http://huddledmasses.org/twitter-in-your-console-prompt-using-ps-jobs-for-background-work/ipmo/' title='Import-Module'><img width="150" height="80" src="http://huddledmasses.org/wordpress/wp-content/uploads/2009/11/ipmo-150x80.png" class="attachment-thumbnail" alt="Import-Module prompts for login info" title="Import-Module"/></a>
<a rel="nofollow" target="_blank" href='http://huddledmasses.org/twitter-in-your-console-prompt-using-ps-jobs-for-background-work/new-tweet/' title='New-Tweet'><img width="150" height="80" src="http://huddledmasses.org/wordpress/wp-content/uploads/2009/11/new-tweet-150x80.png" class="attachment-thumbnail" alt="New-Tweet is used to send tweets" title="New-Tweet"/></a>
<a rel="nofollow" target="_blank" href='http://huddledmasses.org/twitter-in-your-console-prompt-using-ps-jobs-for-background-work/get-tweet/' title='Get-Tweet'><img width="150" height="79" src="http://huddledmasses.org/wordpress/wp-content/uploads/2009/11/get-tweet-150x79.png" class="attachment-thumbnail" alt="Get-Tweet is used to retrieve cached tweets" title="Get-Tweet"/></a>
</p> <div class="posh code posh" style="font-family:monospace;"><span style="color:#666666;font-style:italic;">&lt;# Starting with TwitterLib.dll from http://code.google.com/p/wittytwitter/<br />
&nbsp; &nbsp;ToDo:<br />
&nbsp; &nbsp;* Add persistent search support (via bing?) and a search command<br />
&nbsp; &nbsp;* Add Block commands<br />
&nbsp; &nbsp;* Consider using new TweetSharp lib when they release one not dependent on extension methods. TwitterLib is *really* rough.<br />
#&gt;</span><br />
<span style="color:#666699;font-weight:bold;">param</span><span style="color:#333;">&#40;</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">System</span>.<span style="color:#003366;">Management</span>.<span style="color:#003366;">Automation</span>.<span style="color:#003366;">PSCredential</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$twitterCred</span> <span style="color:#66cc66;">=</span> <span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Credential</span></span><span style="color:#333;">&#41;</span>, <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">int</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$interval</span> <span style="color:#66cc66;">=</span> <span style="color:#cc66cc;">60</span> <span style="color:#333;">&#41;</span><br />
&nbsp;<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">StrictMode</span></span> <span style="color:#000066;">-Version</span> Latest<br />
<span style="color:#666666;font-style:italic;"># ((1 / $interval) + (2 / ($interval * 3))) * 3,600 &nbsp;... must be less than 150</span><br />
<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#40;</span><span style="color:#cc66cc;">1</span> <span style="color:#66cc66;">/</span> <span style="color:#660033;font-weight:bold;">$interval</span><span style="color:#333;">&#41;</span> <span style="color:#66cc66;">+</span> <span style="color:#333;">&#40;</span><span style="color:#cc66cc;">2</span> <span style="color:#66cc66;">/</span> <span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$interval</span> <span style="color:#66cc66;">*</span> <span style="color:#cc66cc;">3</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span> <span style="color:#66cc66;">*</span> <span style="color:#cc66cc;">3600</span><span style="color:#333;">&#41;</span> <span style="color:#000066;">-ge</span> <span style="color:#cc66cc;">150</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">throw</span> <span style="color:#009900;">"Your interval is set too short, you should set it over 40"</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#660033;font-weight:bold;">$null</span> <span style="color:#66cc66;">=</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>Reflection.<span style="color:#003366;">Assembly</span><span style="color:#333;">&#93;</span></span>::<span style="color:#003366;">LoadFrom</span><span style="color:#333;">&#40;</span> <span style="color:#009900;">"$PsScriptRoot&#92;TwitterLib.dll"</span> <span style="color:#333;">&#41;</span> <br />
<span style="color:#660033;font-weight:bold;">$global</span>:twitter <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Object</span></span> TwitterLib.<span style="color:#003366;">TwitterNet</span> <span style="color:#660033;font-weight:bold;">$twitterCred</span>.<span style="color:#003366;">UserName</span>.<span style="color:#003366;">TrimStart</span><span style="color:#333;">&#40;</span><span style="color:#009900;">"&#92;"</span><span style="color:#333;">&#41;</span>, <span style="color:#660033;font-weight:bold;">$twitterCred</span>.<span style="color:#003366;">Password</span><br />
<span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">ClientName</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"PoshTweet"</span><br />
<br />
<span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Job</span></span> Twitter <span style="color:#000066;">-EA</span> <span style="color:#cc66cc;">0</span><span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Stop-<span style="font-style:normal;">Job</span></span> <span style="color:#000066;">-Passthru</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">Job</span></span><br />
<span style="color:#0066cc;font-style:italic;">Start-<span style="font-style:normal;">Job</span></span> <span style="color:#000066;">-Name</span> <span style="color:#009900;">"Twitter"</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">System</span>.<span style="color:#003366;">Management</span>.<span style="color:#003366;">Automation</span>.<span style="color:#003366;">PSCredential</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$Cred</span>,<span style="color:#660033;font-weight:bold;">$ScriptRoot</span>, <span style="color:#660033;font-weight:bold;">$interval</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$null</span> <span style="color:#66cc66;">=</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>Reflection.<span style="color:#003366;">Assembly</span><span style="color:#333;">&#93;</span></span>::<span style="color:#003366;">LoadFrom</span><span style="color:#333;">&#40;</span> <span style="color:#009900;">"$ScriptRoot&#92;TwitterLib.dll"</span> <span style="color:#333;">&#41;</span><br />
<br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$twitter</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Object</span></span> TwitterLib.<span style="color:#003366;">TwitterNet</span> <span style="color:#660033;font-weight:bold;">$Cred</span>.<span style="color:#003366;">UserName</span>.<span style="color:#003366;">TrimStart</span><span style="color:#333;">&#40;</span><span style="color:#009900;">"&#92;"</span><span style="color:#333;">&#41;</span>, <span style="color:#660033;font-weight:bold;">$Cred</span>.<span style="color:#003366;">Password</span><br />
&nbsp; &nbsp;<span style="color:#666666;font-style:italic;"># $twitter.ClientName = "PoshTweet"</span><br />
<br />
&nbsp; &nbsp;<span style="color:#666666;font-style:italic;">## This part depends on HttpRest. If it's not present, it just won't work...</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Module</span></span> <span style="color:#000066;">-List</span> HttpRest <span style="color:#000066;">-EA</span> <span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Import-<span style="font-style:normal;">Module</span></span> HttpRest<br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$isgd</span> &nbsp; <span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?is.gd/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$xrl</span> &nbsp; &nbsp;<span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?xrl.us/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$snip</span> &nbsp; <span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?(?:snurl|snipr|snipurl)&#92;.com/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$twurl</span> &nbsp;<span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?twurl.nl/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$tiny</span> &nbsp; <span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?tinyurl.com/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$shrink</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?shrinkster.com/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$bitly</span> &nbsp;<span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?bit.ly/([^?/ ]*)&#92;b"</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$trim</span> &nbsp; <span style="color:#66cc66;">=</span> <span style="color:#009900;">"(?:https?://)?tr.im/([^?/ ]*)&#92;b"</span><br />
<br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">function</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">string</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$string</span>, <span style="color:#660033;font-weight:bold;">$matches</span>, <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">scriptblock</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$getBlock</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">for</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$i</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$matches</span>.<span style="color:#003366;">Count</span><span style="color:#66cc66;">-</span><span style="color:#cc66cc;">1</span>; <span style="color:#660033;font-weight:bold;">$i</span> <span style="color:#000066;">-ge</span> <span style="color:#cc66cc;">0</span>; <span style="color:#660033;font-weight:bold;">$i</span><span style="color:#66cc66;">--</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$string</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$string</span>.<span style="color:#003366;">Remove</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$matches</span><span style="color:#333;">&#91;</span><span style="color:#660033;font-weight:bold;">$i</span><span style="color:#333;">&#93;</span>.<span style="color:#003366;">Index</span>, <span style="color:#660033;font-weight:bold;">$matches</span><span style="color:#333;">&#91;</span><span style="color:#660033;font-weight:bold;">$i</span><span style="color:#333;">&#93;</span>.<span style="color:#003366;">Length</span><span style="color:#333;">&#41;</span>.<span style="color:#003366;">Insert</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$matches</span><span style="color:#333;">&#91;</span><span style="color:#660033;font-weight:bold;">$i</span><span style="color:#333;">&#93;</span>.<span style="color:#003366;">Index</span>, <span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$matches</span><span style="color:#333;">&#91;</span><span style="color:#660033;font-weight:bold;">$i</span><span style="color:#333;">&#93;</span>.<span style="color:#003366;">groups</span><span style="color:#333;">&#91;</span><span style="color:#cc66cc;">1</span><span style="color:#333;">&#93;</span>.<span style="color:#003366;">value</span> <span style="color:#66cc66;">|</span> <span style="color:#66cc66;">%</span> <span style="color:#660033;font-weight:bold;">$getBlock</span> <span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">write-<span style="font-style:normal;">output</span></span> <span style="color:#660033;font-weight:bold;">$string</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Resolve-<span style="font-style:normal;">URL</span></span> <span style="color:#333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>ValueFromPipeline<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">PROCESS</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$old</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$url</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$isgd</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp; <span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#333;">&#40;</span><span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//is.gd/{0}-"</span> <span style="color:#000066;">-f</span> <span style="color:#660033;font-weight:bold;">$_</span> <span style="color:#333;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> TEXT <span style="color:#009900;">"//*[@id='main']/*[local-name() = 'p']/*[local-name() = 'a']/@href"</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$xrl</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp; &nbsp;<span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//metamark.net/api/rest/simple"</span> &nbsp;@<span style="color:#333;">&#123;</span>short_url<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$_</span><span style="color:#333;">&#125;</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> TEXT <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$snip</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp; <span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//snipurl.com/resolveurl"</span> &nbsp; &nbsp; &nbsp; &nbsp;@<span style="color:#333;">&#123;</span>id<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$_</span><span style="color:#333;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> TEXT <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$twurl</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp;<span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//tweetburner.com/links/$_"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> TEXT <span style="color:#009900;">"//div[4]/p/a/@href"</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$tiny</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp; <span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//tinyurl.com/preview.php"</span> &nbsp; &nbsp; &nbsp; @<span style="color:#333;">&#123;</span>num<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$_</span><span style="color:#333;">&#125;</span> &nbsp; &nbsp; &nbsp; <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> TEXT <span style="color:#009900;">"//a[@id='redirecturl']/@href"</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$shrink</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//shrinkster.com/Track.aspx"</span> &nbsp; &nbsp; @<span style="color:#333;">&#123;</span>AddressID<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$_</span><span style="color:#333;">&#125;</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> TEXT <span style="color:#009900;">"//*[@id='tdOriginalURL']"</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$trim</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp;<span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//api.tr.im/api/trim_destination.xml"</span> @<span style="color:#333;">&#123;</span>trimpath<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$_</span><span style="color:#333;">&#125;</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> Text <span style="color:#009900;">"//trim/destination"</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#666666;font-style:italic;"># bitly's is horrid, 'cause it requires an apiKey, and returns invalid xml</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> Replace<span style="color:#66cc66;">-</span>Matches <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#660033;font-weight:bold;">$bitly</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> &nbsp;<span style="color:#333;">&#123;</span><span style="color:#0066cc;font-style:italic;">Invoke-<span style="font-style:normal;">Http</span></span> GET <span style="color:#009900;">"http<span style="color:#000099;font-weight:bold;">`:</span>//api.bit.ly/expand"</span> @<span style="color:#333;">&#123;</span>version <span style="color:#66cc66;">=</span> <span style="color:#009900;">"2.0.1"</span>; login<span style="color:#66cc66;">=</span><span style="color:#009900;">"jaykul"</span>; apiKey<span style="color:#66cc66;">=</span><span style="color:#009900;">"R_05c31e25dd38fb6113044336ae23a441"</span>; format<span style="color:#66cc66;">=</span><span style="color:#009900;">"xml"</span>; shortUrl<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$_</span> <span style="color:#333;">&#125;</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Receive-<span style="font-style:normal;">Http</span></span> Text <span style="color:#66cc66;">|%</span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$_</span> <span style="color:#000066;">-replace</span> <span style="color:#009900;">".*longUrl&#92;&gt;(.*)&#92;&lt;/longUrl.*"</span>,<span style="color:#009900;">''</span> <span style="color:#333;">&#125;</span><span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Write-<span style="font-style:normal;">Output</span></span> <span style="color:#660033;font-weight:bold;">$url</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">else</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">filter</span> <span style="color:#0066cc;font-style:italic;">Resolve-<span style="font-style:normal;">URL</span></span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$_</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#666666;font-style:italic;">## And this, depends on Growl. If it's not working, we just won't do it...</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Module</span></span> <span style="color:#000066;">-List</span> Growl <span style="color:#000066;">-EA</span> <span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Import-<span style="font-style:normal;">Module</span></span> Growl<br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Register-<span style="font-style:normal;">GrowlType</span></span> PoshTweet NewTweet <span style="color:#000066;">-AppIcon</span> <span style="color:#009900;">"$ScriptRoot&#92;PoshTweetSq.png"</span> <span style="color:#000066;">-Icon</span> <span style="color:#009900;">"$ScriptRoot&#92;PoshTweetSq.png"</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$urlpat</span> <span style="color:#66cc66;">=</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#009900;">"(?:http:|ftp:)//[^ ]+"</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">function</span> PostProcess <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">PARAM</span><span style="color:#333;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>ValueFromPipeline<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span>, Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">100</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><span style="color:#660033;font-weight:bold;">$status</span><br />
,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">ref</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$LastId</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">PROCESS</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$status</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">Member</span></span> NoteProperty Tweet <span style="color:#000066;">-Value</span> $<span style="color:#333;">&#40;</span> <span style="color:#0066cc;font-style:italic;">Resolve-<span style="font-style:normal;">URL</span></span> <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">Text</span> <span style="color:#333;">&#41;</span> <span style="color:#000066;">-Input</span> <span style="color:#660033;font-weight:bold;">$status</span> <span style="color:#000066;">-Passthru</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$LastId</span>.<span style="color:#003366;">Value</span> <span style="color:#000066;">-lt</span> <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">id</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$LastId</span>.<span style="color:#003366;">Value</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">id</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Module</span></span> Growl <span style="color:#000066;">-EA</span> <span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">TimeLine</span> <span style="color:#000066;">-eq</span> <span style="color:#009900;">"DirectMessages"</span> <span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$urlpat</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">Tweet</span><span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">Select</span> <span style="color:#000066;">-First</span> <span style="color:#cc66cc;">1</span> <span style="color:#000066;">-Expand</span> Value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#66cc66;">!</span><span style="color:#660033;font-weight:bold;">$url</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"http://twitter.com/inbox"</span> <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">else</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$url</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"http://twitter.com/{0}/status/{1}"</span> <span style="color:#000066;">-f</span> <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">ScreenName</span>, <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">Id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066cc;font-style:italic;">Send-<span style="font-style:normal;">Growl</span></span> PoshTweet NewTweet <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">FullName</span> <span style="color:#660033;font-weight:bold;">$status</span>.<span style="color:#003366;">Tweet</span> <span style="color:#000066;">-Url</span> <span style="color:#660033;font-weight:bold;">$url</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Write-<span style="font-style:normal;">Output</span></span> <span style="color:#660033;font-weight:bold;">$status</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color:#666666;font-style:italic;">## Initialize the "last" values so we don't get spammed at the begining</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$LastTweet</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">RetrieveTimeline</span><span style="color:#333;">&#40;</span> <span style="color:#009900;">"Friends"</span>, <span style="color:#cc66cc;">0</span>, <span style="color:#cc66cc;">5</span>, <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#93;</span></span>::<span style="color:#003366;">Empty</span> <span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">Select</span> <span style="color:#000066;">-Last</span> <span style="color:#cc66cc;">1</span> <span style="color:#000066;">-Expand</span> Id<br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$LastReply</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">RetrieveTimeline</span><span style="color:#333;">&#40;</span> <span style="color:#009900;">"Replies"</span>, <span style="color:#cc66cc;">0</span>, <span style="color:#cc66cc;">2</span>, <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#93;</span></span>::<span style="color:#003366;">Empty</span> <span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">Select</span> <span style="color:#000066;">-Last</span> <span style="color:#cc66cc;">1</span> <span style="color:#000066;">-Expand</span> Id<br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$LastDm</span> &nbsp; &nbsp;<span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">GetDirectMessages</span><span style="color:#333;">&#40;</span> <span style="color:#cc66cc;">0</span>, <span style="color:#cc66cc;">1</span><span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">Select</span> <span style="color:#000066;">-Last</span> <span style="color:#cc66cc;">1</span> <span style="color:#000066;">-Expand</span> Id<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$i</span> <span style="color:#66cc66;">=</span> <span style="color:#cc66cc;">0</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">while</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666666;font-style:italic;"># initially, shows all tweets, then, only new ones</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">GetFriendsTimeline</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$lastTweet</span> <span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> PostProcess <span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">ref</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$LastTweet</span><span style="color:#333;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color:#666666;font-style:italic;"># check for these two only every 3rd time</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#66cc66;">!</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$i</span><span style="color:#66cc66;">++</span> <span style="color:#66cc66;">%</span> <span style="color:#cc66cc;">3</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#666666;font-style:italic;"># initially shows nothing, then new dms</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">GetDirectMessages</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$lastDm</span> <span style="color:#333;">&#41;</span>.<span style="color:#003366;">ToTweetCollection</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> PostProcess <span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">ref</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$lastDm</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$twitter</span>.<span style="color:#003366;">GetReplies</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$lastReply</span> <span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> PostProcess <span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">ref</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$lastReply</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;">sleep</span> <span style="color:#660033;font-weight:bold;">$interval</span> <span style="color:#666666;font-style:italic;"># Twitter allows 150 updates per hour</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span> <span style="color:#000066;">-Arg</span> <span style="color:#660033;font-weight:bold;">$twitterCred</span>, <span style="color:#660033;font-weight:bold;">$PSScriptRoot</span>, <span style="color:#660033;font-weight:bold;">$interval</span><br />
<br />
<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#66cc66;">!</span><span style="color:#333;">&#40;</span><span style="color:#0066cc;font-style:italic;">Test-<span style="font-style:normal;">Path</span></span> Variable:TwitterOriginalPrompt <span style="color:#000066;">-EA</span> <span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$Global</span>:TwitterOriginalPrompt <span style="color:#66cc66;">=</span> $<span style="color:#333;">&#123;</span><span style="color:#666699;font-weight:bold;">Function</span>:<span style="color:#660033;">Prompt</span><span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#660033;font-weight:bold;">$global</span>:LastTweets <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">new-<span style="font-style:normal;">object</span></span> <span style="color:#003366;font-weight:bold;">System</span>.<span style="color:#003366;">Collections</span>.<span style="color:#003366;">Generic</span>.<span style="color:#003366;">List</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">PSObject</span><span style="color:#333;">&#93;</span></span><br />
<span style="color:#666699;font-weight:bold;">function</span> Global:<span style="color:#660033;">Prompt</span> <span style="color:#333;">&#123;</span> <br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">Array</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$newTweets</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;">rcjb</span> twitter<br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$newTweets</span> <span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$index</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$global</span>:LastTweets.<span style="color:#003366;">Count</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">ForEach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#660033;font-weight:bold;">$newTweets</span><span style="color:#333;">&#91;</span>$<span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$newTweets</span>.<span style="color:#003366;">Count</span><span style="color:#66cc66;">-</span><span style="color:#cc66cc;">1</span><span style="color:#333;">&#41;</span>..0<span style="color:#333;">&#93;</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$tweet</span>.<span style="color:#003366;">Index</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$index</span><span style="color:#66cc66;">++</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$global</span>:LastTweets.<span style="color:#003366;">Add</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$i</span> <span style="color:#66cc66;">=</span> <span style="color:#cc66cc;">0</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">foreach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#660033;font-weight:bold;">$newTweets</span> <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Sort-<span style="font-style:normal;">Object</span></span> DateCreated <span style="color:#66cc66;">|</span> <span style="color:#0066cc;font-style:italic;">Out-<span style="font-style:normal;">String</span></span> <span style="color:#000066;">-Stream</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$i</span> <span style="color:#66cc66;">+=</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">int</span><span style="color:#333;">&#93;</span></span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$tweet</span><span style="color:#333;">&#91;</span><span style="color:#cc66cc;">0</span><span style="color:#333;">&#93;</span> <span style="color:#000066;">-ne</span> <span style="color:#009900;">" "</span><span style="color:#333;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">write-<span style="font-style:normal;">host</span></span> <span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#000066;">-Fore</span> $<span style="color:#333;">&#40;</span> <span style="color:#666699;font-weight:bold;">switch</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$i</span> <span style="color:#66cc66;">%</span> <span style="color:#cc66cc;">2</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <span style="color:#cc66cc;">0</span> <span style="color:#333;">&#123;</span><span style="color:#009900;">"DarkGray"</span><span style="color:#333;">&#125;</span> default <span style="color:#333;">&#123;</span> <span style="color:#009900;">"Gray"</span><span style="color:#333;">&#125;</span> <span style="color:#333;">&#125;</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">return</span> <span style="color:#66cc66;">&amp;</span><span style="color:#660033;font-weight:bold;">$TwitterOriginalPrompt</span> @args <br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Tweet</span></span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>CmdletBinding<span style="color:#333;">&#40;</span>DefaultParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"WhereTweet"</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
<span style="color:#666699;font-weight:bold;">PARAM</span><span style="color:#333;">&#40;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$false</span>,ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"Search"</span>,Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">1</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$ByUser</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$false</span>,ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"Search"</span>,Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$WithText</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$false</span>,ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"Search"</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">Int</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$Index</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$false</span>,ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"WhereTweet"</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">ScriptBlock</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$Where</span><span style="color:#66cc66;">=</span><span style="color:#333;">&#123;</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#125;</span><br />
, <br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#666699;font-weight:bold;">Switch</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$First</span>, <br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#666699;font-weight:bold;">Switch</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$Last</span><br />
<span style="color:#333;">&#41;</span><br />
<span style="color:#666699;font-weight:bold;">BEGIN</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$PSCmdlet</span>.<span style="color:#003366;">ParameterSetName</span> <span style="color:#000066;">-eq</span> <span style="color:#009900;">"Search"</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">string</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$clauses</span> <span style="color:#66cc66;">=</span> @<span style="color:#333;">&#40;</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$ByUser</span><span style="color:#333;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#123;</span> &nbsp;<span style="color:#660033;font-weight:bold;">$clauses</span> <span style="color:#66cc66;">+=</span> <span style="color:#009900;">'$ByUser -contains $_.ScreenName'</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$WithText</span><span style="color:#333;">&#41;</span> &nbsp; &nbsp;<span style="color:#333;">&#123;</span> &nbsp;<span style="color:#660033;font-weight:bold;">$clauses</span> <span style="color:#66cc66;">+=</span> <span style="color:#009900;">'$_.Tweet -match ($WithText -join "|")'</span> &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$Index</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> &nbsp;<span style="color:#660033;font-weight:bold;">$clauses</span> <span style="color:#66cc66;">+=</span> <span style="color:#009900;">'$Index -contains $_.Index'</span> &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$Where</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;">iex</span> <span style="color:#009900;">"{ $($clauses -join ' -and ' ) }"</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">ScriptBlock</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$RealPredicate</span> <span style="color:#66cc66;">=</span> <span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$args</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">Where</span> <span style="color:#660033;font-weight:bold;">$Where</span> <span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span> &nbsp; <br />
<span style="color:#666699;font-weight:bold;">Process</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$First</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$LastTweets</span>.<span style="color:#003366;">FindFirst</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$RealPredicate</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">elseif</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$Last</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$LastTweets</span>.<span style="color:#003366;">FindLast</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$RealPredicate</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">else</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$LastTweets</span>.<span style="color:#003366;">FindAll</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$RealPredicate</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Start-<span style="font-style:normal;">Url</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#333;">&#91;</span>CmdletBinding<span style="color:#333;">&#40;</span>SupportsShouldProcess<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span>,ValueFromPipeline<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><span style="color:#660033;font-weight:bold;">$msg</span><span style="color:#333;">&#41;</span><br />
<span style="color:#666699;font-weight:bold;">PROCESS</span><span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">ForEach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$link</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#0066cc;font-style:italic;">Select-<span style="font-style:normal;">Url</span></span> <span style="color:#660033;font-weight:bold;">$msg</span>.<span style="color:#003366;">Tweet</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$PSCmdlet</span>.<span style="color:#003366;">ShouldProcess</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$link</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066cc;font-style:italic;">Start-<span style="font-style:normal;">Process</span></span> <span style="color:#660033;font-weight:bold;">$link</span> <span style="color:#000066;">-Confirm</span>:<span style="color:#660033;font-weight:bold;">$False</span> <span style="color:#66cc66;">&gt;</span> <span style="color:#660033;font-weight:bold;">$null</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#660033;font-weight:bold;">$urlpat</span> <span style="color:#66cc66;">=</span> <span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">regex</span><span style="color:#333;">&#93;</span></span><span style="color:#009900;">"(?:http:|ftp:)//[^ ]+"</span><br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Select-<span style="font-style:normal;">Url</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span> <span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span>,ValueFromPipeline<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$msg</span><span style="color:#333;">&#41;</span><br />
<span style="color:#666699;font-weight:bold;">PROCESS</span><span style="color:#333;">&#123;</span> <span style="color:#660033;font-weight:bold;">$urlpat</span>.<span style="color:#003366;">Matches</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$msg</span> <span style="color:#333;">&#41;</span> <span style="color:#66cc66;">|</span> <span style="color:#660033;">Select</span> <span style="color:#000066;">-Expand</span> Value <span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<br />
<br />
<br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Reply</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">int</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$index</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$OFS</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">" "</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$source</span> <span style="color:#66cc66;">=</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Tweet</span></span> <span style="color:#000066;">-Index</span> <span style="color:#660033;font-weight:bold;">$index</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"$args"</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#000066;">-notmatch</span> <span style="color:#660033;font-weight:bold;">$source</span>.<span style="color:#003366;">ScreenName</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$tweet</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">"@$($source.ScreenName) $tweet"</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">AddTweet</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$tweet</span>, <span style="color:#660033;font-weight:bold;">$source</span>.<span style="color:#003366;">Id</span> <span style="color:#333;">&#41;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Tweet</span></span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$OFS</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">" "</span><br />
&nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">AddTweet</span><span style="color:#333;">&#40;</span> <span style="color:#009900;">"$args"</span> <span style="color:#333;">&#41;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">Friend</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">string</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">foreach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$user</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">FollowUser</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$user</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">Friend</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">string</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">foreach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$user</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">UnfollowUser</span><span style="color:#333;">&#40;</span> <span style="color:#660033;font-weight:bold;">$user</span> <span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Friend</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">string</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#66cc66;">!</span><span style="color:#660033;font-weight:bold;">$userName</span> <span style="color:#000066;">-or</span> <span style="color:#660033;font-weight:bold;">$userNaem</span>.<span style="color:#003366;">Count</span> <span style="color:#000066;">-eq</span> <span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">GetFriends</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#41;</span> <br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span> <span style="color:#666699;font-weight:bold;">else</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#666699;font-weight:bold;">foreach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$user</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">GetUser</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$user</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">FriendTweet</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#666699;font-weight:bold;">Param</span><span style="color:#333;">&#40;</span><span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">string</span><span style="color:#333;">&#91;</span><span style="color:#333;">&#93;</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">foreach</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$user</span> <span style="color:#666699;font-weight:bold;">in</span> <span style="color:#660033;font-weight:bold;">$userName</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$global</span>:twitter.<span style="color:#003366;">GetUserTimeline</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$user</span><span style="color:#333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<br />
<span style="color:#666666;font-style:italic;">#.Synopsis </span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;Calculates a relative text version of a duration</span><br />
<span style="color:#666666;font-style:italic;">#.Description</span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;Generates a string approximation of a timespan, like "x minutes" or "x days." Note this method does not add "about" to the front, nor "ago" to the end unless you pass them in.</span><br />
<span style="color:#666666;font-style:italic;">#.Parameter Span</span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;A TimeSpan to convert to a string</span><br />
<span style="color:#666666;font-style:italic;">#.Parameter Before</span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;A DateTime representing the start of a timespan.</span><br />
<span style="color:#666666;font-style:italic;">#.Parameter After</span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;A DateTime representing the end of a timespan.</span><br />
<span style="color:#666666;font-style:italic;">#.Parameter Prefix</span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;The prefix string, pass "about" to render: "about 4 minutes"</span><br />
<span style="color:#666666;font-style:italic;">#.Parameter Postfix</span><br />
<span style="color:#666666;font-style:italic;"># &nbsp;The postfix string, like "ago" to render: "about 4 minutes ago"</span><br />
<span style="color:#666699;font-weight:bold;">function</span> <span style="color:#0066cc;font-style:italic;">ConvertTo-<span style="font-style:normal;">RelativeTimeString</span></span> <span style="color:#333;">&#123;</span><br />
<span style="color:#333;">&#91;</span>CmdletBinding<span style="color:#333;">&#40;</span>DefaultParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"TwoDates"</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
<span style="color:#666699;font-weight:bold;">PARAM</span><span style="color:#333;">&#40;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"TimeSpan"</span>,Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>TimeSpan<span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$span</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"TwoDates"</span>,Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span>,ValueFromPipeline<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Alias<span style="color:#333;">&#40;</span><span style="color:#009900;">"DateCreated"</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>DateTime<span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$before</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>ParameterSetName<span style="color:#66cc66;">=</span><span style="color:#009900;">"TwoDates"</span>, Mandatory<span style="color:#66cc66;">=</span><span style="color:#660033;font-weight:bold;">$true</span>, Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">0</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span>DateTime<span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$after</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">1</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$prefix</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">""</span><br />
,<br />
&nbsp; &nbsp;<span style="color:#333;">&#91;</span>Parameter<span style="color:#333;">&#40;</span>Position<span style="color:#66cc66;">=</span><span style="color:#cc66cc;">2</span><span style="color:#333;">&#41;</span><span style="color:#333;">&#93;</span><br />
&nbsp; &nbsp;<span style="color:#003366;font-weight:bold;"><span style="color:#333;">&#91;</span><span style="color:#003366;font-weight:bold;">String</span><span style="color:#333;">&#93;</span></span><span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#66cc66;">=</span> <span style="color:#009900;">""</span><br />
&nbsp;<br />
<span style="color:#333;">&#41;</span><br />
<span style="color:#666699;font-weight:bold;">PROCESS</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color:#666699;font-weight:bold;">if</span><span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$PSCmdlet</span>.<span style="color:#003366;">ParameterSetName</span> <span style="color:#000066;">-eq</span> <span style="color:#009900;">"TwoDates"</span><span style="color:#333;">&#41;</span> <span style="color:#333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#660033;font-weight:bold;">$span</span> <span style="color:#66cc66;">=</span> <span style="color:#660033;font-weight:bold;">$after</span> <span style="color:#66cc66;">-</span> <span style="color:#660033;font-weight:bold;">$before</span><br />
&nbsp; &nbsp;<span style="color:#333;">&#125;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color:#009900;">"$(<br />
&nbsp; &nbsp;switch($span.TotalSeconds) {<br />
&nbsp; &nbsp; &nbsp; {$_ -le 1} &nbsp; &nbsp; &nbsp;{ "</span><span style="color:#660033;font-weight:bold;">$prefix</span> a second <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break } &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; {$_ -le 60} &nbsp; &nbsp; { "</span><span style="color:#660033;font-weight:bold;">$prefix</span> $<span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$span</span>.<span style="color:#003366;">Seconds</span><span style="color:#333;">&#41;</span> seconds <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break }<br />
&nbsp; &nbsp; &nbsp; {$_ -le 120} &nbsp; &nbsp;{ "</span><span style="color:#660033;font-weight:bold;">$prefix</span> a minute <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break }<br />
&nbsp; &nbsp; &nbsp; {$_ -le 2700} &nbsp; { "</span><span style="color:#660033;font-weight:bold;">$prefix</span> $<span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$span</span>.<span style="color:#003366;">Minutes</span><span style="color:#333;">&#41;</span> minutes <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break } # 45 minutes or less<br />
&nbsp; &nbsp; &nbsp; {$_ -le 5400} &nbsp; { "</span><span style="color:#660033;font-weight:bold;">$prefix</span> an hour <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break } # 45 minutes to 1.5 hours <br />
&nbsp; &nbsp; &nbsp; {$_ -le 86400} &nbsp;{ "</span><span style="color:#660033;font-weight:bold;">$prefix</span> $<span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$span</span>.<span style="color:#003366;">Hours</span><span style="color:#333;">&#41;</span> hours <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break } # less than a day<br />
&nbsp; &nbsp; &nbsp; {$_ -le 172800} { "</span><span style="color:#660033;font-weight:bold;">$prefix</span> <span style="color:#cc66cc;">1</span> day <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break } # less than two days<br />
&nbsp; &nbsp; &nbsp; default &nbsp; &nbsp; &nbsp; &nbsp; { "</span><span style="color:#660033;font-weight:bold;">$prefix</span> $<span style="color:#333;">&#40;</span><span style="color:#660033;font-weight:bold;">$span</span>.<span style="color:#003366;">Days</span><span style="color:#333;">&#41;</span> days <span style="color:#660033;font-weight:bold;">$postfix</span> <span style="color:#009900;">"; break } <br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;)"</span>.<span style="color:#003366;">Trim</span><span style="color:#333;">&#40;</span><span style="color:#333;">&#41;</span><br />
<span style="color:#333;">&#125;</span><br />
<span style="color:#333;">&#125;</span><br />
<br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> tweet <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Tweet</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> follow <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">Friend</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> unfollow <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">Friend</span></span><br />
<br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> nt <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Tweet</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> nr <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Reply</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> <span style="color:#333399;font-weight:bold;font-style:italic;">gt</span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Tweet</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> gft <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">FriendTweet</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> af <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">Friend</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> rf <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">Friend</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> sau <span style="color:#0066cc;font-style:italic;">Start-<span style="font-style:normal;">Url</span></span><br />
<br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">TwitterUser</span></span> <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Friend</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">TwitterFriend</span></span> <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">Friend</span></span><br />
<span style="color:#0066cc;font-style:italic;">Set-<span style="font-style:normal;">Alias</span></span> <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">TwitterFriend</span></span> <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">Friend</span></span><br />
<br />
<br />
<span style="color:#0066cc;font-style:italic;">Export-<span style="font-style:normal;">ModuleMember</span></span> <span style="color:#000066;">-Function</span> <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Reply</span></span>, <span style="color:#0066cc;font-style:italic;">New-<span style="font-style:normal;">Tweet</span></span>, <span style="color:#0066cc;font-style:italic;">Add-<span style="font-style:normal;">Friend</span></span>, <span style="color:#0066cc;font-style:italic;">Remove-<span style="font-style:normal;">Friend</span></span>, <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Friend</span></span>, <span style="color:#0066cc;font-style:italic;">Resolve-<span style="font-style:normal;">URL</span></span>, <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">Tweet</span></span>, <span style="color:#0066cc;font-style:italic;">Get-<span style="font-style:normal;">FriendTweet</span></span>, <span style="color:#0066cc;font-style:italic;">Start-<span style="font-style:normal;">Url</span></span>, <span style="color:#0066cc;font-style:italic;">ConvertTo-<span style="font-style:normal;">RelativeTimeString</span></span> <span style="color:#000066;">-Alias</span> <span style="color:#66cc66;">*</span></div><div class="feedflare">
<a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=5sFkS-hdmzA:QLWHTQxyfyU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?d=yIl2AUoC8zA" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=5sFkS-hdmzA:QLWHTQxyfyU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?i=5sFkS-hdmzA:QLWHTQxyfyU:F7zBnMyn0Lo" border="0"></a> <a rel="nofollow" target="_blank" href="http://feeds.feedburner.com/~ff/HuddledMasses?a=5sFkS-hdmzA:QLWHTQxyfyU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/HuddledMasses?i=5sFkS-hdmzA:QLWHTQxyfyU:D7DqB2pKExk" border="0"></a>
</div><img src="http://feeds.feedburner.com/~r/HuddledMasses/~4/5sFkS-hdmzA" height="1" width="1"/>]]></content:encoded>
         <media:content></media:content>
      </item>
      <item>
         <title>Episode 91 - PowerScripting Podcast - Oisin Grehan on Pmodem and Modules</title>
         <link>http://feedproxy.google.com/~r/Powerscripting/~3/ujlPBAjc9Rk/index.php</link>
         <description>Tonight we talk to Oisin Grehan about Pmodem and PowerShell Modules&lt;div id=&quot;ia37&quot;&gt;&lt;ul&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;h2&gt;&lt;font size=&quot;4&quot;&gt;News&lt;/font&gt;&lt;/h2&gt;&lt;div&gt;&lt;i&gt;&lt;span&gt;&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;Do you have what it takes to be the ultimate script warrior?&amp;nbsp; Find out with&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;Questâs&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;PowerPack&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;Challenge&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;.&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;Quest Software is sponsoring&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;a&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;PowerShell Scripting&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;contest where you can test your skills and get paid.&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;Do you have the muscle to bring home the prize?&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;The winner takes home a cool $1,000 USD to spend on Amazon.com&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;/span&gt;&lt;div&gt;&lt;i&gt;&lt;span&gt;&lt;font size=&quot;2&quot;&gt;Check out the details at&amp;nbsp;&lt;/font&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;epwe&quot; title=&quot;quest.com/challenge&quot; target=&quot;_blank&quot; href=&quot;http://www.quest.com/PowerGUIContestPodcast102009&quot;&gt;&lt;font size=&quot;2&quot;&gt;quest.com/challenge&lt;/font&gt;&lt;/a&gt;&lt;font size=&quot;2&quot;&gt;.&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The guys at Devfarm are really pumping out the tutorials on their&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;i9yo&quot; title=&quot;new blog&quot; target=&quot;_blank&quot; href=&quot;http://blog.powerwf.com/&quot;&gt;new blog&lt;/a&gt;. For example:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;vhi:&quot; title=&quot;What is a Workflow&quot; target=&quot;_blank&quot; href=&quot;http://blog.powerwf.com/post/212184431&quot;&gt;What is a Workflow&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;gb99&quot; title=&quot;PowerWF Terminology&quot; target=&quot;_blank&quot; href=&quot;http://blog.powerwf.com/post/213802536&quot;&gt;PowerWF Terminology&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;rnut&quot; title=&quot;Channel 9 has posted&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/mediaandmicrocode/archive/2009/10/30/new-wpk-video-online-multitouch-fingerpaint-in-30-lines-of-powershell-script.aspx&quot;&gt;Channel 9 has posted&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;another one of James Brundage's WPK videos &quot;How to Write a MultiTouch FingerPaint with WPK&quot;&lt;/li&gt;&lt;li&gt;Dmitry has a new video out as well, this one is about&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;u7mm&quot; title=&quot;how to create a PowerGUI powerpack&quot; target=&quot;_blank&quot; href=&quot;http://dmitrysotnikov.wordpress.com/2009/10/29/video-on-creating-a-powerpack/&quot;&gt;how to create a PowerGUI powerpack&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Interview&lt;/h2&gt;&lt;p&gt;&lt;i&gt;This segment is brought to you by&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;zah2&quot; title=&quot;SAPIEN Technologies&quot; target=&quot;_blank&quot; href=&quot;http://sapien.com/&quot;&gt;&lt;i&gt;SAPIEN Technologies&lt;/i&gt;&lt;/a&gt;&lt;i&gt;.&lt;/i&gt;&lt;/p&gt;
&lt;h4&gt;Links&lt;/h4&gt;&lt;div&gt;&lt;ul&gt;&lt;li id=&quot;tvf5&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.nivot.org/2009/11/02/PowerShell20IntroducingThePModemFileTransferProtocol.aspx&quot;&gt;http://www.nivot.org/2009/11/02/PowerShell20IntroducingThePModemFileTransferProtocol.aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;h4&gt;Questions&lt;/h4&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;ChadMiller: ##Any differences in way I would write a binary module in V2 vs V1 snappin&lt;/li&gt;&lt;li&gt;PowershellJedi: ## is the green &amp;amp; yellow progress bar built into powershell v2 i've seen it used in other cmdlets&lt;/li&gt;&lt;li&gt;glnsize: ## opinion on winrm and remoting in the realworld... after managing your sp farm.&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;h2&gt;&lt;font size=&quot;4&quot;&gt;Resources&lt;/font&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Jeff Hicks&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;n6n0&quot; title=&quot;posts about PModem and Folder Listings&quot; target=&quot;_blank&quot; href=&quot;http://jdhitsolutions.com/blog/2009/11/pmodem-and-folder-listings/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed&quot;&gt;posts about PModem and Folder Listings&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Mike over at PowerShell Musings is&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;igkj&quot; title=&quot;doing a series on creating your own PowerShell Hosting App&quot; target=&quot;_blank&quot; href=&quot;http://powershellstation.com/2009/10/12/writing-your-own-powershell-hosting-app-part-1-introduction/&quot;&gt;doing a series on creating your own PowerShell Hosting App&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Lee Holmes&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;sf4-&quot; title=&quot;blogged about an Activity Monitor&quot; target=&quot;_blank&quot; href=&quot;http://www.leeholmes.com/blog/PowerShellActivityTracker.aspx&quot;&gt;blogged about an Activity Monitor&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;he wrote in PowerShell&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;&lt;h2&gt;&lt;font size=&quot;4&quot;&gt;Tips&lt;/font&gt;&lt;/h2&gt;&lt;div&gt;[stackoverflow / serverfault ad]&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;avor&quot; title=&quot;A one-liner from Hal&quot; target=&quot;_blank&quot; href=&quot;http://twitter.com/halr9000/statuses/5260468753&quot;&gt;A one-liner from Hal&lt;/a&gt;&amp;nbsp;showing how to write a log message with functional context.&lt;/li&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;mdfb&quot; title=&quot;Pipelines and Parameters&quot; target=&quot;_blank&quot; href=&quot;http://poshcode.org/1428&quot;&gt;Pipelines and Parameters&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Serverfault.com:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;q:6-&quot; title=&quot;Return folders whcih contain one file&quot; target=&quot;_blank&quot; href=&quot;http://serverfault.com/questions/74484/how-to-find-directories-that-contain-only-on-file&quot;&gt;Return folders whcih contain one file&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;&lt;font size=&quot;4&quot;&gt;Gotchas&lt;/font&gt;&lt;/h2&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;An&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;ig89&quot; title=&quot;oddity in PowerShell operators&quot; target=&quot;_blank&quot; href=&quot;http://www.ericwoodford.com/node/262&quot;&gt;oddity in PowerShell operators&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;ot9t&quot; title=&quot;WMI class win32_product isn't installed&quot; target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/wmi/archive/2009/09/16/wmi-remote-query-for-win32-product-class-results-in-generic-failure-error-0x80041001.aspx&quot;&gt;WMI class win32_product isn't installed&lt;/a&gt;&amp;nbsp;on all systems&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;br class=&quot;Apple-interchange-newline&quot;/&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/Powerscripting/~4/ujlPBAjc9Rk&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>PowerScripting@Gmail.com (Jonathan Walz &amp; Hal Rottenberg)</author>
         <guid isPermaLink="false">http://powerscripting.libsyn.com/index.php?post_id=546963#</guid>
         <pubDate>Sun, 08 Nov 2009 18:21:00 -0800</pubDate>
         <media:content></media:content>
         <category>podcasts</category>
         <enclosure length="53423084" url="http://feedproxy.google.com/~r/Powerscripting/~5/8ZEiV2Nm8-E/PSPodcast-091.mp3" type="audio/mpeg"/>
      </item>
   </channel>
</rss>
<!-- fe11.pipes.sp1.yahoo.com uncompressed/chunked Sun Nov 22 17:42:25 PST 2009 -->
