<?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>Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx</link><description>Do you hate Add-Member as much as I do? Wait - maybe you aren't familiar with Add-Member or the glory of PowerShell's Adaptive Type System. (ATS). When I looked at the .NET type system, my reaction was "....almost". I'm not trying to throw a rock at .NET</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8930582</link><pubDate>Sun, 07 Sep 2008 15:10:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8930582</guid><dc:creator>Shin Wu Lien</dc:creator><description>&lt;p&gt;Interesting article, I would never have thought of modifying System.Object itself!&lt;/p&gt;
&lt;p&gt;But any script that used this would no longer be portable across machines, correct? &amp;nbsp;You couldn't just copy the script, you'd have to copy/edit the appropriate XML file too.&lt;/p&gt;
&lt;p&gt;Will you add the PSAddMember() method to the XML files that come with PowerShell 2.0 by default?&lt;/p&gt;
&lt;p&gt;Also, in other PowerShell blogs, performance tests have shown that add-member is terribly slow, so I hope some calories are being spent in PowerShell 2.0 to make that cmdlet faster (I have a script which parses log data which uses add-member, and it's as slow as a sick dog on a hot day...).&lt;/p&gt;
&lt;p&gt;Thank You!&lt;/p&gt;</description></item><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8930873</link><pubDate>Sun, 07 Sep 2008 18:54:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8930873</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;p&gt;&amp;gt; Will you add the PSAddMember() method to the XML files that come with PowerShell 2.0 by default?&lt;/p&gt;
&lt;p&gt;Watch that space. &amp;nbsp;I put it on the list of things to consider.&lt;/p&gt;
&lt;p&gt;&amp;gt; Also, in other PowerShell blogs, performance tests have shown that add-member is terribly slow, so I hope some calories are being spent in PowerShell 2.0 to make that cmdlet faster (I have a script which parses log data which uses add-member, and it's as slow as a sick dog on a hot day...).&lt;/p&gt;
&lt;p&gt;We've done a bunch of perf work in general. &amp;nbsp;I don't know whether this was one of the scenarios that was optimized for.&lt;/p&gt;
&lt;p&gt;jps&lt;/p&gt;
</description></item><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8931245</link><pubDate>Sun, 07 Sep 2008 23:11:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8931245</guid><dc:creator>Rob Lancaster</dc:creator><description>&lt;p&gt;I for one have numerous scripts lying round my hard drive, that use add-member to tack lots of random things onto objects - and this example will help cut the code no end.... specialy when I want to tag objects with note-properties as they flow through the pipeline.&lt;/p&gt;
&lt;p&gt;However, I'd love to be able to construct a powershell object from scratch using a &amp;quot;create-object&amp;quot; like command... &lt;/p&gt;
&lt;p&gt;This would save me having to use add-type and writing every thing in C# !&lt;/p&gt;
&lt;p&gt;Keep up the good work.&lt;/p&gt;</description></item><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8931338</link><pubDate>Mon, 08 Sep 2008 00:13:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8931338</guid><dc:creator>Hal Rottenberg</dc:creator><description>&lt;p&gt;Wow. This is really cool--almost. Man, as Shin mentions, the need to ship the XML around with the script really kills it. :(&lt;/p&gt;
&lt;p&gt;I *really* hope you guys can improve this scenario for PS2. I would really love for add-member to be more useful.&lt;/p&gt;</description></item><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8931955</link><pubDate>Mon, 08 Sep 2008 06:31:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8931955</guid><dc:creator>karl prosser</dc:creator><description>&lt;p&gt;cool to see some discussion on that, i really need to blog my libraries about this stuff. i've put a lot of time into object synethsis and transformation in PS&lt;/p&gt;</description></item><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8936117</link><pubDate>Tue, 09 Sep 2008 11:21:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8936117</guid><dc:creator>Anthony</dc:creator><description>&lt;p&gt;Did you guys see this news from the Mono project? &lt;a rel="nofollow" target="_new" href="http://tirania.org/blog/archive/2008/Sep-08.html"&gt;http://tirania.org/blog/archive/2008/Sep-08.html&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Hate Add-Member? (PowerShell's Adaptive Type System to the Rescue)</title><link>http://blogs.msdn.com/powershell/archive/2008/09/06/hate-add-member-powershell-s-adaptive-type-system.aspx#8967370</link><pubDate>Sat, 27 Sep 2008 08:39:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8967370</guid><dc:creator>Per Østergaard</dc:creator><description>&lt;p&gt;When I need to construct an object, I simply use this approach:&lt;/p&gt;
&lt;p&gt;$obj=&amp;quot;&amp;quot; | select Name,Address,Phone&lt;/p&gt;
&lt;p&gt;$obj.name=&amp;quot;blah&amp;quot;&lt;/p&gt;
&lt;p&gt;And as I normally just want to add additional properties, I find this must easier or perhaps more intuitive than using add-member:&lt;/p&gt;
&lt;p&gt;$obj=$obj| select *,NewProperty&lt;/p&gt;
&lt;p&gt;$obj.NewProperty=456&lt;/p&gt;
&lt;p&gt;I can even get rid of existing Properties -&lt;/p&gt;
&lt;p&gt;$obj=$obj | select * -exclude Phone&lt;/p&gt;
&lt;p&gt;$obj&lt;/p&gt;</description></item></channel></rss>