View Single Post
Old 10-10-2006   #4 (permalink)
Bruce Payette [MSFT]


 
 

Re: accessing the extended type system from C#

Correct. You can use the properties collection to get all the properties,
the methods collection to get all the methods or just use the members
collection to get everything. This works from within PowerShell as well:

PS (116) > (ls)[0].psobject


Members : {PSPath, PSParentPath, PSChildName, PSDrive...}
Properties : {PSPath, PSParentPath, PSChildName, PSDrive...}
Methods : {get_Name, get_Parent, CreateSubdirectory, Create...}
ImmediateBaseObject : figures_appendix
BaseObject : figures_appendix
TypeNames : {System.IO.DirectoryInfo, System.IO.FileSystemInfo,
System.MarshalByRefObject
, System.Object}

-bruce

--
Bruce Payette [MSFT]
Windows PowerShell Technical Lead
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scr.../hubs/msh.mspx


"Adam Milazzo" <adamm@san.rr.com> wrote in message
news:uIop%23Zx6GHA.4608@TK2MSFTNGP03.phx.gbl...
> klumsy@xtra.co.nz wrote:
>> (bool)psobj.Properties["psiscontainer"].Value
>>
>> seems to be the way.
>> no method to list the properties?

>
> Well if psobj.Properties is a collection, you can probably enumerate the
> key/value pairs.



My System SpecsSystem Spec