Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Why exclude PropertieSet from Properties?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-10-2008   #1 (permalink)
Bob Landau
Guest


 

Why exclude PropertieSet from Properties?

[System.Management.Automation.PSmemberTypes]:roperties -band
[System.Management.Automation.PSmemberTypes]:ropertyset

The above expression returns false which means that

Get-Process | Get-Member -MemberType Properties

will not return the PropertySet property associated with
System.Diagnositic.Process

The same applies to MemberSets and Methods even though at least I read
Methods to include MemberSets likewise with Properties.

These appear to be a conscious effort on the PS team but I don't understand
their reasoning.

http://msdn2.microsoft.com/en-us/lib...mbertypes.aspx

My System SpecsSystem Spec
Old 01-10-2008   #2 (permalink)
Kirk Munro [MVP]
Guest


 

Re: Why exclude PropertieSet from Properties?

Personal opinion?

It allows users to get the member types they want (and only the member types
they want).

With the current implementation I can do this:

Get-Process | Get-Member -MemberType Property,PropertySet

or

Get-Process | Get-Member -MemberType Property

or

Get-Process | Get-Member -MemberType PropertySet

Similarly if I want to get just note properties, I can do this:

Get-Process | Get-Member -MemberType NoteProperty

If Property gave me PropertySet types as well, I'd have to use a
Where-Object call in the pipeline to filter them out.

Why would you want to get property sets at the same time that you are
getting properties?

--
Kirk Munro [MVP]
Poshoholic
http://poshoholic.com


"Bob Landau" <BobLandau@xxxxxx> wrote in message
news:AB24A049-6160-4B32-87A1-106B94F4EE3F@xxxxxx
Quote:

> [System.Management.Automation.PSmemberTypes]:roperties -band
> [System.Management.Automation.PSmemberTypes]:ropertyset
>
> The above expression returns false which means that
>
> Get-Process | Get-Member -MemberType Properties
>
> will not return the PropertySet property associated with
> System.Diagnositic.Process
>
> The same applies to MemberSets and Methods even though at least I read
> Methods to include MemberSets likewise with Properties.
>
> These appear to be a conscious effort on the PS team but I don't
> understand
> their reasoning.
>
> http://msdn2.microsoft.com/en-us/lib...mbertypes.aspx

My System SpecsSystem Spec
Old 01-10-2008   #3 (permalink)
Karl Prosser[MVP]
Guest


 

Re: Why exclude PropertieSet from Properties?

It's surprising that many parameters on many cmdlets actually take
arrays, rather than the single items that we usually put in. A lot of
hidden power.

-Karl
My System SpecsSystem Spec
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
get-childitem -exclude bug bep PowerShell 7 03-11-2008 07:47 PM
Exclude File Kerry Live Folder Share 0 12-21-2007 07:17 PM
Cannot access properties in "local area connection properties" win Samzabrus Vista networking & sharing 2 10-09-2007 10:00 AM
Bug in Get-ChildItem -exclude loworbit@gmail.com PowerShell 4 12-19-2006 05:58 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51