Skip to Main Content
PowerShell in Depth
book

PowerShell in Depth

by Don Jones, Jeffery Hicks, Richard Siddaway
February 2013
Intermediate to advanced content levelIntermediate to advanced
632 pages
20h 20m
English
Manning Publications
Content preview from PowerShell in Depth

Chapter 21. Creating objects for output

This chapter covers

  • “Objectifying” your output
  • Creating custom objects
  • Working with collections of properties

In the previous chapter, we showed you how to create a simple script and turn it into a function. We emphasized the need for scripts and functions to output only one kind of thing, and in those simple examples you found it easy to comply because you were running only a single command. But you’re doubtless going to come across situations where you need to run multiple commands, combine pieces of their output, and use that as the output of your script or function. This chapter will show you how: The goal is to create a custom object that consolidates the information you need and then output ...

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

PowerShell in Depth, Second Edition

PowerShell in Depth, Second Edition

Don Jones, Richard Siddaway, Jeffery Hicks
PowerShell in Practice

PowerShell in Practice

Richard Siddaway

Publisher Resources

ISBN: 9781617290558Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link