![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | how do I find the available properties -- say of get-childitem Hi, I'm going through the book by Payette and trying to learn something about Powershell. I see some of the examples use get-childitem and then format the output. For example one pipes the output to format-table name. How can I find out what all of the properties are, including name. If I just do get-childitem I only see a few of the available properties. I'm guessing this question would be common to other cmdlets as well. |
| | #2 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem Get-ChildItem | Get-Member # this gets you everything Get-ChildItem | Get-Member -MemberType Property "Art" <Art@discussions.microsoft.com> wrote in message news:C9D273EB-2DB8-4398-8194-98677B1FB352@microsoft.com... > Hi, > > I'm going through the book by Payette and trying to learn something about > Powershell. I see some of the examples use get-childitem and then format > the > output. For example one pipes the output to format-table name. How can I > find out what all of the properties are, including name. If I just do > get-childitem I only see a few of the available properties. > > I'm guessing this question would be common to other cmdlets as well. |
| | #3 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem Brandon, Thanks, that's just what I needed. "Brandon Shell" wrote: > Get-ChildItem | Get-Member # this gets you everything > Get-ChildItem | Get-Member -MemberType Property > > "Art" <Art@discussions.microsoft.com> wrote in message > news:C9D273EB-2DB8-4398-8194-98677B1FB352@microsoft.com... > > Hi, > > > > I'm going through the book by Payette and trying to learn something about > > Powershell. I see some of the examples use get-childitem and then format > > the > > output. For example one pipes the output to format-table name. How can I > > find out what all of the properties are, including name. If I just do > > get-childitem I only see a few of the available properties. > > > > I'm guessing this question would be common to other cmdlets as well. > > |
| | #4 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem > I'm guessing this question would be common to other cmdlets as well. I should clarify that the available properties are not of the cmdlet, but of the objects it produces. I just wanted you to be clear about that because some cmdlets produce more than one type of object. For example, get-childitem will produce different types of objects based on your location. If you are in the registry it will produce RegistryKey objects while if you are in the file system you will get FileInfo or DirectoryInfo objects. So were you to pipe from get-childitem to get-member you'll see different results based on your location. "Art" <Art@discussions.microsoft.com> wrote in message news:C9D273EB-2DB8-4398-8194-98677B1FB352@microsoft.com... > Hi, > > I'm going through the book by Payette and trying to learn something about > Powershell. I see some of the examples use get-childitem and then format > the > output. For example one pipes the output to format-table name. How can I > find out what all of the properties are, including name. If I just do > get-childitem I only see a few of the available properties. > > I'm guessing this question would be common to other cmdlets as well. |
| | #5 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem another trick to return all the properties , rather than just seeing what they are is Get-ChildItem | Select-Object * or if for some reason you really want to know all about those proproperties and are making complex decisions in code, for each object you can access all the properties this way (get-childitem)[0].psobject.properties i often do things like this [datetime]::Now | % { $_.psobject.properties } it just contains information at a deeper level than get-member does.. and more useful when doing advanced things programatically. |
| | #6 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem Thanks for the additional info. It's going to take me a little time to get through all of this. "klumsy@xtra.co.nz" wrote: > another trick to return all the properties , rather than just seeing > what they are is > > Get-ChildItem | Select-Object * > > or if for some reason you really want to know all about those > proproperties and are making complex decisions in code, for each > object you can access all the properties this way > > (get-childitem)[0].psobject.properties > > i often do things like this > > > [datetime]::Now | % { $_.psobject.properties } > > > it just contains information at a deeper level than get-member does.. > and more useful when doing advanced things programatically. > > > > > |
| | #7 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem I'm afraid I have to betray even more ignorance. How would I "be in" the registry when using get-childitem? Actually I'm not sure how I "was in" the file system -- I guess the file system seemed like the target of the cmdlet. If I type get-Childitem | get-member, I haven't explicitly given the cmdlet a target -- based on what you've said, I must be doing it implicitly somehow. Could you explain this a bit for me? "Marcel J. Ortiz [MSFT]" wrote: > > I'm guessing this question would be common to other cmdlets as well. > > I should clarify that the available properties are not of the cmdlet, but of > the objects it produces. I just wanted you to be clear about that because > some cmdlets produce more than one type of object. For example, > get-childitem will produce different types of objects based on your > location. If you are in the registry it will produce RegistryKey objects > while if you are in the file system you will get FileInfo or DirectoryInfo > objects. So were you to pipe from get-childitem to get-member you'll see > different results based on your location. > > > "Art" <Art@discussions.microsoft.com> wrote in message > news:C9D273EB-2DB8-4398-8194-98677B1FB352@microsoft.com... > > Hi, > > > > I'm going through the book by Payette and trying to learn something about > > Powershell. I see some of the examples use get-childitem and then format > > the > > output. For example one pipes the output to format-table name. How can I > > find out what all of the properties are, including name. If I just do > > get-childitem I only see a few of the available properties. > > > > I'm guessing this question would be common to other cmdlets as well. > |
| | #8 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem By being "in" the registry I meant that your current location is the registry. Part of your session state or powershell environment is your current location. When you call any of the core cmdlets (get-help about_core_commands) how they behave will depend on what provider (get-help about_provider) holds your current location. If you are in the path c:\windows, well that's part of the FileSystem and the functionality of get-childitem will be defined by the FileSystem provider. On the other hand, if your current location is HKLM:\Software\Microsoft then get-childitem will be handled by the registry provider. You can get your current location with the "get-location" cmdlet. For example, here is my current path and the provider that the path belongs to: PS HKLM:\software\microsoft> get-location | ft Path, Provider Path Provider ---- -------- HKLM:\software\microsoft Microsoft.PowerShell.Core\Registry "Art" <Art@discussions.microsoft.com> wrote in message news:6A84C7C8-6E65-431A-ACCD-EA843A492037@microsoft.com... > I'm afraid I have to betray even more ignorance. How would I "be in" the > registry when using get-childitem? Actually I'm not sure how I "was in" > the > file system -- I guess the file system seemed like the target of the > cmdlet. > If I type get-Childitem | get-member, I haven't explicitly given the > cmdlet a > target -- based on what you've said, I must be doing it implicitly > somehow. > Could you explain this a bit for me? > > > > "Marcel J. Ortiz [MSFT]" wrote: > >> > I'm guessing this question would be common to other cmdlets as well. >> >> I should clarify that the available properties are not of the cmdlet, but >> of >> the objects it produces. I just wanted you to be clear about that >> because >> some cmdlets produce more than one type of object. For example, >> get-childitem will produce different types of objects based on your >> location. If you are in the registry it will produce RegistryKey objects >> while if you are in the file system you will get FileInfo or >> DirectoryInfo >> objects. So were you to pipe from get-childitem to get-member you'll see >> different results based on your location. >> >> >> "Art" <Art@discussions.microsoft.com> wrote in message >> news:C9D273EB-2DB8-4398-8194-98677B1FB352@microsoft.com... >> > Hi, >> > >> > I'm going through the book by Payette and trying to learn something >> > about >> > Powershell. I see some of the examples use get-childitem and then >> > format >> > the >> > output. For example one pipes the output to format-table name. How >> > can I >> > find out what all of the properties are, including name. If I just do >> > get-childitem I only see a few of the available properties. >> > >> > I'm guessing this question would be common to other cmdlets as well. >> |
| | #9 (permalink) |
| Guest | Re: how do I find the available properties -- say of get-childitem Marcel, Thanks very much. It's funny how I can wind up learning about things I didn't expect when pursuing different information. I was never aware that I could change to the registry from within powershell. Thanks for all your help. "Marcel J. Ortiz [MSFT]" wrote: > By being "in" the registry I meant that your current location is the > registry. Part of your session state or powershell environment is your > current location. When you call any of the core cmdlets (get-help > about_core_commands) how they behave will depend on what provider (get-help > about_provider) holds your current location. If you are in the path > c:\windows, well that's part of the FileSystem and the functionality of > get-childitem will be defined by the FileSystem provider. On the other > hand, if your current location is HKLM:\Software\Microsoft then > get-childitem will be handled by the registry provider. You can get your > current location with the "get-location" cmdlet. For example, here is my > current path and the provider that the path belongs to: > > PS HKLM:\software\microsoft> get-location | ft Path, Provider > > Path Provider > ---- -------- > HKLM:\software\microsoft > Microsoft.PowerShell.Core\Registry > > > > > "Art" <Art@discussions.microsoft.com> wrote in message > news:6A84C7C8-6E65-431A-ACCD-EA843A492037@microsoft.com... |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get-childitem bug? | RJ | PowerShell | 2 | 02-29-2008 01:29 PM |
| using Get-ChildItem | foamy | PowerShell | 9 | 02-15-2008 04:32 AM |
| get-childitem | Brandon Shell [MVP] | PowerShell | 4 | 12-03-2007 12:58 PM |
| Cannot access properties in "local area connection properties" win | Samzabrus | Vista networking & sharing | 2 | 10-09-2007 10:00 AM |
| Registry and Get-ChildItem | fixitchris | PowerShell | 7 | 11-14-2006 06:02 PM |