Working with Objects in PowerShell

Everything we do in PowerShell revolves around working with objects. Objects, in PowerShell, may have properties or methods (or both).

It is difficult to describe an object without resorting to: an object is a representation of a thing or item of data. We might use an analogy to attempt to give meaning to the term.

This book is an object.

The book has properties which describe physical characteristics, such as the number of pages, the weight, or size. It has metadata (information about data) properties that describe the author, the publisher, the table of contents, and so on.

The book might also have methods. A method affects the change on the state of an object. For example, there might be methods to open or close the book or methods to jump to different chapters. A method might also convert an object into a different form. For example, there might be a method to copy a page, or even destructive methods such as one to split the book.

PowerShell has a variety of commands that allow us to work with sets (or collections) of objects in a pipeline.

In this chapter, we are going to cover the following topics:

  • Pipelines
  • Members
  • Enumerating and filtering
  • Selecting and sorting
  • Grouping and measuring
  • Comparing
  • Importing, exporting, and converting
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.229.111