<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Essential PowerShell: Define default properties for custom objects</title>
	<atom:link href="http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/</link>
	<description>Totally addicted to PowerShell</description>
	<lastBuildDate>Thu, 09 Feb 2012 00:54:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Kirk Munro</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1465</link>
		<dc:creator><![CDATA[Kirk Munro]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 12:45:22 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1465</guid>
		<description><![CDATA[Nice workaround, that works quite well!  I&#039;m going to have to play with it and try a few scenarios I have in mind to see if it supports them (one in particular I&#039;m curious about -- overriding the default property set for a type that already has it defined...does it just override the default property set or does it lose all other type information with the override).  Anyhow, thanks for taking the time to build the workaround!  I simply hadn&#039;t gotten around to it yet.]]></description>
		<content:encoded><![CDATA[<p>Nice workaround, that works quite well!  I&#8217;m going to have to play with it and try a few scenarios I have in mind to see if it supports them (one in particular I&#8217;m curious about &#8212; overriding the default property set for a type that already has it defined&#8230;does it just override the default property set or does it lose all other type information with the override).  Anyhow, thanks for taking the time to build the workaround!  I simply hadn&#8217;t gotten around to it yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russell Slater</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1462</link>
		<dc:creator><![CDATA[Russell Slater]]></dc:creator>
		<pubDate>Sat, 12 Dec 2009 00:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1462</guid>
		<description><![CDATA[After posting my comment I did some searching and found a question on stackoverflow detailing that it was a bug.

I created a workaround:
http://stackoverflow.com/questions/1369542/can-you-set-an-objects-defaultdisplaypropertyset-in-a-powershell-v2-script/1891215#1891215

If you get a chance, take a look and let me know what you think. All feedback is appreciated.

Thanks for the update!]]></description>
		<content:encoded><![CDATA[<p>After posting my comment I did some searching and found a question on stackoverflow detailing that it was a bug.</p>
<p>I created a workaround:<br />
<a href="http://stackoverflow.com/questions/1369542/can-you-set-an-objects-defaultdisplaypropertyset-in-a-powershell-v2-script/1891215#1891215" rel="nofollow">http://stackoverflow.com/questions/1369542/can-you-set-an-objects-defaultdisplaypropertyset-in-a-powershell-v2-script/1891215#1891215</a></p>
<p>If you get a chance, take a look and let me know what you think. All feedback is appreciated.</p>
<p>Thanks for the update!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kirk Munro</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1461</link>
		<dc:creator><![CDATA[Kirk Munro]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 22:41:38 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1461</guid>
		<description><![CDATA[Unfortunately the PowerShell Team broke this capability in PowerShell 2.0 RTM.  They are aware of the issue and it is my understanding that they will fix it in a future release.  I&#039;ll be keeping my eyes open for that fix because this functionality is too handy to do without.]]></description>
		<content:encoded><![CDATA[<p>Unfortunately the PowerShell Team broke this capability in PowerShell 2.0 RTM.  They are aware of the issue and it is my understanding that they will fix it in a future release.  I&#8217;ll be keeping my eyes open for that fix because this functionality is too handy to do without.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russell Slater</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1460</link>
		<dc:creator><![CDATA[Russell Slater]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-1460</guid>
		<description><![CDATA[I just tried this out on PowerShell v2 and it doesn&#039;t work. Any ideas on what might have changed and how to fix it?

I did get it working correctly on PowerShell v1.

Great post, very useful.]]></description>
		<content:encoded><![CDATA[<p>I just tried this out on PowerShell v2 and it doesn&#8217;t work. Any ideas on what might have changed and how to fix it?</p>
<p>I did get it working correctly on PowerShell v1.</p>
<p>Great post, very useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Shepard</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-902</link>
		<dc:creator><![CDATA[Mike Shepard]]></dc:creator>
		<pubDate>Wed, 24 Dec 2008 03:30:37 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-902</guid>
		<description><![CDATA[This is really good info.  I&#039;m having a problem with it, though, and you might be able to help.  I&#039;m trying to access the default properties of an object in a custom pshost in order to populate a grid (or a treeview...it doesn&#039;t really matter which), and I can&#039;t seem to find the PSStandardMembers member in the members collection.  I&#039;ve tried using the .Members(&quot;PSExtended&quot;).Value to get the Extended property set (since the property set in question was loaded from a formatting ps1xml file), and then looking in that object for a member with a name of &quot;DefaultDisplayPropertySet&quot;, but can&#039;t seem to find it.  I&#039;ve tried lots of other combinations as well, all to no avail.  If nothing else works, I can always do an invoke of a pipeline that does $o.PSStandardMembers.DefaultDisplayPropertySet, but that seems like a hack.  Any ideas?]]></description>
		<content:encoded><![CDATA[<p>This is really good info.  I&#8217;m having a problem with it, though, and you might be able to help.  I&#8217;m trying to access the default properties of an object in a custom pshost in order to populate a grid (or a treeview&#8230;it doesn&#8217;t really matter which), and I can&#8217;t seem to find the PSStandardMembers member in the members collection.  I&#8217;ve tried using the .Members(&#8220;PSExtended&#8221;).Value to get the Extended property set (since the property set in question was loaded from a formatting ps1xml file), and then looking in that object for a member with a name of &#8220;DefaultDisplayPropertySet&#8221;, but can&#8217;t seem to find it.  I&#8217;ve tried lots of other combinations as well, all to no avail.  If nothing else works, I can always do an invoke of a pipeline that does $o.PSStandardMembers.DefaultDisplayPropertySet, but that seems like a hack.  Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kirk Munro</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-862</link>
		<dc:creator><![CDATA[Kirk Munro]]></dc:creator>
		<pubDate>Fri, 05 Sep 2008 14:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-862</guid>
		<description><![CDATA[Thanks Hugo!

Just so you know, removing the second required script would be pretty easy.  I use Get-PSResourceString because I try to show how easy it can be to access the canned error messages that come with PowerShell, localized in the language you run PowerShell in.  But my scripts are not fully localized because I don&#039;t have the time or the resources to do that.  They&#039;re just as localized as I can make them.  If you want to use the Select-Member script without the Get-PSResourceString script, you could just replace the Get-PSResourceString calls with strings indicating what the error is in the language of your choice.  For example, this:

throw $(Get-PSResourceString -BaseName &#039;ParameterBinderStrings&#039; -ResourceId &#039;AmbiguousParameterSet&#039;

could be changed to this:

throw &#039;Ambiguous parameter set.&#039;

or if you want the actual English text used in PowerShell, this:

throw &#039;Parameter set cannot be resolved using the specified named parameters.&#039;

That might let you use the full Select-Member function more easily.  But of course you could strip it down to just what you need as well, or roll your own function based on the first script to add the default property set.]]></description>
		<content:encoded><![CDATA[<p>Thanks Hugo!</p>
<p>Just so you know, removing the second required script would be pretty easy.  I use Get-PSResourceString because I try to show how easy it can be to access the canned error messages that come with PowerShell, localized in the language you run PowerShell in.  But my scripts are not fully localized because I don&#8217;t have the time or the resources to do that.  They&#8217;re just as localized as I can make them.  If you want to use the Select-Member script without the Get-PSResourceString script, you could just replace the Get-PSResourceString calls with strings indicating what the error is in the language of your choice.  For example, this:</p>
<p>throw $(Get-PSResourceString -BaseName &#8216;ParameterBinderStrings&#8217; -ResourceId &#8216;AmbiguousParameterSet&#8217;</p>
<p>could be changed to this:</p>
<p>throw &#8216;Ambiguous parameter set.&#8217;</p>
<p>or if you want the actual English text used in PowerShell, this:</p>
<p>throw &#8216;Parameter set cannot be resolved using the specified named parameters.&#8217;</p>
<p>That might let you use the full Select-Member function more easily.  But of course you could strip it down to just what you need as well, or roll your own function based on the first script to add the default property set.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hugo Peeters</title>
		<link>http://poshoholic.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-861</link>
		<dc:creator><![CDATA[Hugo Peeters]]></dc:creator>
		<pubDate>Fri, 05 Sep 2008 06:41:47 +0000</pubDate>
		<guid isPermaLink="false">http://kirkmunro.wordpress.com/2008/07/05/essential-powershell-define-default-properties-for-custom-objects/#comment-861</guid>
		<description><![CDATA[Hi Kirk,

Great research!
I am a big fan of Powershell and I very regularly use custom objects in my scripts. They just give me so much flexibility, for instance to do sorting, filtering, grouping or formatting afterwards.
Using a Format-... command in a script or function to get the standard output set properly is killing, because it make it impossible to use additional filtering, sorting and so on.
I am definitively going to use the first method you describe. Maybe I&#039;ll create my own function to make it easier to implement in my scripts.
The full Select-Member script might be a but too much for me, especially because of the second required script.
Thanks!
Hugo Peeters
www.peetersonline.nl]]></description>
		<content:encoded><![CDATA[<p>Hi Kirk,</p>
<p>Great research!<br />
I am a big fan of Powershell and I very regularly use custom objects in my scripts. They just give me so much flexibility, for instance to do sorting, filtering, grouping or formatting afterwards.<br />
Using a Format-&#8230; command in a script or function to get the standard output set properly is killing, because it make it impossible to use additional filtering, sorting and so on.<br />
I am definitively going to use the first method you describe. Maybe I&#8217;ll create my own function to make it easier to implement in my scripts.<br />
The full Select-Member script might be a but too much for me, especially because of the second required script.<br />
Thanks!<br />
Hugo Peeters<br />
<a href="http://www.peetersonline.nl" rel="nofollow">http://www.peetersonline.nl</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

