Skip to Main Content
Learn PowerShell Scripting in a Month of Lunches
book

Learn PowerShell Scripting in a Month of Lunches

by Jeffery Hicks, Don Jones
December 2017
Beginner content levelBeginner
352 pages
10h 31m
English
Manning Publications
Content preview from Learn PowerShell Scripting in a Month of Lunches

Chapter 12. Objects: the best kind of output

So far, the tool you’ve been building isn’t querying all the information originally specified in the design established back in chapter 8. That was a deliberate decision we made so that you could get some structure around the tool first. We’ve also held off because once you start querying a bunch of information, you need to take a specific approach to combining it, and we wanted to tackle that approach in a single chapter.

Right now, the “functional” part of the tool looks like this:

# Query data $os = Get-CimInstance -ClassName Win32_OperatingSystem ` -CimSession $session # Close session $session | Remove-CimSession # Output data $os | Select-Object -Prop @{n='ComputerName';e={$computer}}, Version,ServicePackMajorVersion ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Windows PowerShell in a Month of Lunches, Third Edition

Learn Windows PowerShell in a Month of Lunches, Third Edition

Don Jones

Publisher Resources

ISBN: 9781617295096Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link