Tags


So we continue into trying to under Powershell.   This series of articles is not into “Deep Dive” so much as it is to help Administrators and ITPros get a quicker grasp and leap past some of the initial learning curves I had with Powershell

So this time we discover the “GET-MEMBER” command let.

I like to think of GET-MEMBER as my portable phonebook in Powershell.  It shows me everything about those objects in Powershell that a GET-CHILDITEM (or any other command producing output, which is pretty much all of them) does.

So let’s run a GET-MEMEBER on the results of GET-CHILDITEM it will show you everything contained in that list of Objects.  Not the values as such, but the types of information you can get.

image

As you can see there is a LOT of information just on the Filesystem OBJECTS alone.   But it’s not confusing.   It you look you will see it’s broken into two sections.  “System.IO.DirectoryInfo” and “System.IO.FileInfo”.

Similiarly if you run the GET-MEMBER on other Powershell results, it will show you information within them as well.

SET-LOCATION REGISTRY::

GET-CHILDITEM | GET-MEMBER

Will give these results, which show you what information you can manipulate in this context

image

GET-MEMBER is useful on more than just “GET-CHILDITEM”.  I find if I’m not sure types of information are available in the output to manipulate, you run GET-MEMBER.  GET-MEMBER is incredibly powerful because it not only reveals information we want to see, it also reveals “METHODS” which are code or functions we can use to manipulate that data in sometimes more useful ways (Like comparing dates, or parsing the information revealed to us)

We’ll get a little bit more into what we can do with some of the METHODS next time.  

Rock on with Powershell

Sean
The Energized Tech

Advertisements