Now we’ve had a chance to look at Powershell and get a quick glance to see some basics. There is a lot of information provided by GET-MEMBER as to what you can do.
But let’s take a very quick look into what we can do with that information.
In the previous article you may have noticed the use of the “|” character. That’s referred to as “piping”
When we got the output from GET-CHILDITEM, it displayed a list of information on the screen. Mind you it didn’t display ALL the information it got, just the “Important bits” for you and me. The key details.
When we did a
GET-CHILDITEM | GET-MEMBER
What we actually did there was take the list of objects retrieved and dump them DIRECTLY to the GET-MEMBER command. It may not have used all the available Properties of those objects, just the ones it needed.
It would have been the same as running a
GET-CHILDITEM
and getting a small Directory list like
C:\USERS
C:\Windows
DOG.TXT
CAT.BIN
BIRD.EXE
and THEN typing in
GET-MEMBER C:\USERS
GET-MEMBER C:\Windows
GET-MEMBER C:\DOG.TXT
GET-MEMBER C:\CAT.BIN
GET-MEMBER C:\BIRD.EXE
Piping is just a more efficient way of doing things
And Piping can be done more than once on a line. I can run a GET-CHILDITEM, pipe the output to GET-MEMBER and then take the results of the GET-MEMBER and pipe that output into an EXPORT-CSV
And forever and ever until you’ve got the results you need. A Pipe is a lot like a REAL pipe connecting different systems together ending up at a tap. In our case the systems are Powershell Commandlets like GET-CHILDITEM, GET-MEMBER and EXPORT-CSV and the tap at the sink is the resulting output.
Next time we’ll take a look at a way to work with those objects on a more one to one level.
Sean
The Energized Tech




Leave a comment