<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PoshBoard and ConvertTo-HashTable</title><link>http://blogs.msdn.com/b/powershell/archive/2008/11/23/poshboard-and-convertto-hashtable.aspx</link><description>I’m currently watching an cool video of PoshBoard a PowerShell based Web Portal by Pilosite available on CodePlex . It looks great. 
 In the middle of the video I noticed the following script he uses to populate one of the controls on the dashboard:</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: PoshBoard and ConvertTo-HashTable</title><link>http://blogs.msdn.com/b/powershell/archive/2008/11/23/poshboard-and-convertto-hashtable.aspx#9243243</link><pubDate>Sat, 20 Dec 2008 04:55:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9243243</guid><dc:creator>Pilosite</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thank you for theses advices : for sure, this dramatically simplify the stuff !&lt;/p&gt;
&lt;p&gt;I'll implement it this way in the coming version of Poshboard.&lt;/p&gt;
&lt;p&gt;Antoine&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9243243" width="1" height="1"&gt;</description></item><item><title>re: PoshBoard and ConvertTo-HashTable</title><link>http://blogs.msdn.com/b/powershell/archive/2008/11/23/poshboard-and-convertto-hashtable.aspx#9230651</link><pubDate>Wed, 17 Dec 2008 14:04:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9230651</guid><dc:creator>Personal Grants</dc:creator><description>&lt;p&gt;great information thanks this def helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9230651" width="1" height="1"&gt;</description></item><item><title>re: PoshBoard and ConvertTo-HashTable</title><link>http://blogs.msdn.com/b/powershell/archive/2008/11/23/poshboard-and-convertto-hashtable.aspx#9173383</link><pubDate>Thu, 04 Dec 2008 07:14:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9173383</guid><dc:creator>Tim Morton</dc:creator><description>&lt;p&gt;James, you can get around the path problem by using Jeffrey's code as a function like:&lt;/p&gt;
&lt;p&gt;function ConvertTo_HashTable {&lt;/p&gt;
&lt;p&gt; &amp;lt;insert Jeffrey's code here&amp;gt;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;The conversion problem can be fixed by casting the variables as doubles:&lt;/p&gt;
&lt;p&gt;{[double]$_.size - [double]$_.freeSpace}&lt;/p&gt;
&lt;p&gt;Jeffrey, thanks for the code! I have been using the foreach loop method to populate hashes. Using your code will be a much more elegant solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9173383" width="1" height="1"&gt;</description></item><item><title>re: PoshBoard and ConvertTo-HashTable</title><link>http://blogs.msdn.com/b/powershell/archive/2008/11/23/poshboard-and-convertto-hashtable.aspx#9145097</link><pubDate>Wed, 26 Nov 2008 21:41:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9145097</guid><dc:creator>James Johnson</dc:creator><description>&lt;p&gt;1. How do you get the pipe line to execute correctly without specifying the path to ConvertTo-Hashtable? I get the error &amp;quot;convertto-hashtable is not recognized as a cmdlet, function, operable program, or script file.&amp;quot;. I have to specify the path or ./ to avoid the error.&lt;/p&gt;
&lt;p&gt;#2. I also get the error &amp;quot;The operation '[System.UInt64] - [System.UInt64]' is not defined.&lt;/p&gt;
&lt;p&gt;At line:1 char:96&lt;/p&gt;
&lt;p&gt;+ $ht = gwmi win32_logicaldisk -filter &amp;quot;drivetype=3&amp;quot; | ./convertto-hashtable deviceid { $_.size - &amp;nbsp;&amp;lt;&amp;lt;&amp;lt;&amp;lt; $_.freespace }&lt;/p&gt;
&lt;p&gt;The operation '[System.UInt64] - [System.UInt64]' is not defined.&amp;quot;&lt;/p&gt;
&lt;p&gt;It works if you add back the division by 1KB to both the size and freespace fields&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9145097" width="1" height="1"&gt;</description></item><item><title>Dew Drop - November 24, 2008 | Alvin Ashcraft's Morning Dew</title><link>http://blogs.msdn.com/b/powershell/archive/2008/11/23/poshboard-and-convertto-hashtable.aspx#9137092</link><pubDate>Mon, 24 Nov 2008 16:11:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9137092</guid><dc:creator>Dew Drop - November 24, 2008 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.alvinashcraft.com/2008/11/24/dew-drop-november-24-2008/"&gt;http://www.alvinashcraft.com/2008/11/24/dew-drop-november-24-2008/&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9137092" width="1" height="1"&gt;</description></item></channel></rss>