![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | accessing the extended type system from C# say i create a pipeline and run "dir c:\". i get returned a Collection<PSobject> . from this i can get the baseobject for whether its a fileinfo or directoryinfo etc.. however how can i get the extended type system properties.. i.e the PSdrive, PSiscontainer etc etc? Karl |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: accessing the extended type system from C# (bool)psobj.Properties["psiscontainer"].Value seems to be the way. no method to list the properties? |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: accessing the extended type system from C# 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 Specs![]() |
| | #4 (permalink) |
| Guest | 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 Specs![]() |
| | #5 (permalink) |
| Guest | Re: accessing the extended type system from C# yeah, i have been enumeratimng the psobject properties. Bruce Payette [MSFT] wrote: > 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 woah... that a neat trick. its interesting because the psobject properties doesn't show up in get-member i.e (ls)[0] | gm doesn't show a psobject property another supercool trick to add to the collection |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Unable to cast COM object of type 'ADODB.RecordsetClass' to class type 'System.Object[]' | Michel Posseth [MCP] | .NET General | 2 | 03-27-2008 10:04 AM |
| Accessing System 32 and COM API's for Vista thru Powershell | Spooky | PowerShell | 3 | 12-17-2007 08:38 AM |
| system lockup when accessing large files from IDE | nabeel46 | Vista General | 3 | 09-30-2007 06:08 PM |
| Getting Operating System and Chasis type through wmi | greatbarrier86 | PowerShell | 28 | 08-15-2007 07:44 PM |
| Accessing Collection type items using Negative Index Numbers | DBMwS | PowerShell | 3 | 07-02-2006 08:11 PM |