![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Vista 64 System needs Extended warm-up | Vista General | |||
Error accessing system registry | General Discussion | |||
| Re: Unable to cast COM object of type 'ADODB.RecordsetClass' to class type 'System.Object[]' | .NET General | |||
| system lockup when accessing large files from IDE | Vista General | |||
| Accessing Collection type items using Negative Index Numbers | PowerShell | |||