<?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>New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx</link><description>Let me start of by suggesting you take a few minutes and read Laerte Junior’s excellent blog entry Exceptional PowerShell DBA Pt1 Orphaned Users . Laerte does a great job describing the scenario, the approach he took to solving it and then he included</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10350577</link><pubDate>Tue, 18 Sep 2012 19:16:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10350577</guid><dc:creator>Aman Dhally</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is a very nice post.&lt;/p&gt;
&lt;p&gt;Thanks for sharing...&lt;/p&gt;
&lt;p&gt;Aman&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.amandhally.net/"&gt;http://www.amandhally.net/&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10350577" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10292061</link><pubDate>Mon, 09 Apr 2012 23:38:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10292061</guid><dc:creator>pranavkojha</dc:creator><description>&lt;p&gt;Hi Gurus,&lt;/p&gt;
&lt;p&gt;I have created a custom object using this method, &lt;/p&gt;
&lt;p&gt;$object = New-Object Object | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Add-Member NoteProperty MyField 5 -PassThru | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Add-Member ScriptMethod xTimesMyField { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;param($x) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$x * $this.MyField &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} -PassThru &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;$object &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;$object.xTimesMyField(10) &amp;nbsp; &lt;/p&gt;
&lt;p&gt;Now I want to create another object that inherits the properties and methods of this object. How do I do that ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10292061" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10292059</link><pubDate>Mon, 09 Apr 2012 23:33:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10292059</guid><dc:creator>pranavkojha</dc:creator><description>&lt;p&gt;Thanks for the comments. I have a question here,&lt;/p&gt;
&lt;p&gt;How do I create an object that inherits properties/methods of a super-class ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10292059" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10275837</link><pubDate>Thu, 01 Mar 2012 18:57:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10275837</guid><dc:creator>Dan Sheehan</dc:creator><description>&lt;p&gt;I suggest considering a data table in Powershell, as it does retain the order in which the properties are added, and it is truly a data table versus a hash table.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10275837" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10070818</link><pubDate>Sun, 03 Oct 2010 15:33:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10070818</guid><dc:creator>&lt;a href="http://www.hotelscheveningen.net" title="Hotel Scheveningen" target="_blank"&gt;Hotel Scheveningen&lt;/a&gt;</dc:creator><description>&lt;p&gt;What a great tip&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10070818" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10041831</link><pubDate>Fri, 23 Jul 2010 12:10:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10041831</guid><dc:creator>Nashik Property</dc:creator><description>&lt;p&gt;Great blog i like to read this blog daily it has all the useful stuff, i would like to subscribe it so can you please tell me when your blog gets updated.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10041831" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#10012763</link><pubDate>Thu, 13 May 2010 20:55:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10012763</guid><dc:creator>Londen</dc:creator><description>&lt;p&gt;Thanks for the tip, this have made me already changing my scripts!! Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10012763" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#9936926</link><pubDate>Tue, 15 Dec 2009 07:31:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9936926</guid><dc:creator>Schiphol</dc:creator><description>&lt;p&gt;I've started using PS just two weeks ago, and I am impressed. I am so much more productive in terms of scripting, super. Really a big thank you for explaining the Real Time problem with the PowerShell parser.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936926" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#9934852</link><pubDate>Wed, 09 Dec 2009 22:20:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934852</guid><dc:creator>Joshua Einstein</dc:creator><description>&lt;p&gt;Hey Rinimbi, regarding the performance of PSObjects, Karl Prosser, mow, and Brandon Shell have been batting this around for a while. Check out the following URL and in the first sentence he links to other posts that benchmark various methods of creating custom objects.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://karlprosser.com/coder/2008/06/12/generating-a-propertybag-aka-pscustomobject-in-c/"&gt;http://karlprosser.com/coder/2008/06/12/generating-a-propertybag-aka-pscustomobject-in-c/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But depending on your circumstances, I've found the best way to create a huge number of objects with uniform structure is to use the Add-Type cmdlet in PowerShell 2.0 to create an on-the-fly .NET class in C# syntax.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934852" width="1" height="1"&gt;</description></item><item><title>re: New-Object PSObject –Property [HashTable]</title><link>http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx#9934812</link><pubDate>Wed, 09 Dec 2009 20:57:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934812</guid><dc:creator>Rinimbi</dc:creator><description>&lt;p&gt;Very nice! When creating tens of thousands of custom objects, though, is this method (using a hash) the best for performance? &amp;nbsp;If speed is more important than code elegance, what's the best way to create large numbers of custom objects with many (10+) new properties? &amp;nbsp;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934812" width="1" height="1"&gt;</description></item></channel></rss>