Reader small image

You're reading from  Mastering PowerShell Scripting - Fourth Edition

Product typeBook
Published inJun 2021
PublisherPackt
ISBN-139781800206540
Edition4th Edition
Right arrow
Author (1)
Chris Dent
Chris Dent
author image
Chris Dent

Chris Dent is an automation specialist with deep expertise in the PowerShell language. Chris is often found answering questions about PowerShell in both the UK and virtual PowerShell user groups. Chris has been developing in PowerShell since 2007 and has released several modules over the years.
Read more about Chris Dent

Right arrow

Members

At the beginning of this chapter, the idea of properties and methods was introduced. These are part of a set of items collectively known as members. These members are used to interact with an object. A few of the more frequently used members are NoteProperty, ScriptProperty, ScriptMethod, and Event.

What are the member types?

The list of possible member types can be viewed on MSDN, which includes a short description of each member type:

https://docs.microsoft.com/dotnet/api/system.management.automation.psmembertypes?redirectedfrom=MSDN&view=pscore-6.2.0

This chapter focuses on the property members Property, NoteProperty, and ScriptProperty.

The Get-Member command

The Get-Member command can be used to view the different members of an object. For example, it can be used to list the members of a process object returned by Get-Process. The automatic variable $PID holds the process ID of the current PowerShell process:

Get-Process...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering PowerShell Scripting - Fourth Edition
Published in: Jun 2021Publisher: PacktISBN-13: 9781800206540

Author (1)

author image
Chris Dent

Chris Dent is an automation specialist with deep expertise in the PowerShell language. Chris is often found answering questions about PowerShell in both the UK and virtual PowerShell user groups. Chris has been developing in PowerShell since 2007 and has released several modules over the years.
Read more about Chris Dent