0
0
PowerShellscripting~5 mins

Get-Member for object inspection in PowerShell - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the PowerShell cmdlet <code>Get-Member</code> do?

Get-Member shows the properties and methods of an object. It helps you understand what you can do with that object.

Click to reveal answer
beginner
How do you use Get-Member to see the properties of a file object?

Use Get-Item <filepath> | Get-Member. This shows all properties and methods of the file object.

Click to reveal answer
beginner
What is the difference between properties and methods shown by Get-Member?

Properties are details or data about the object (like name or size). Methods are actions you can perform on the object (like copying or deleting).

Click to reveal answer
intermediate
How can you filter Get-Member output to show only methods?

Use Get-Item <filepath> | Get-Member -MemberType Method to see only the methods of an object.

Click to reveal answer
beginner
Why is Get-Member useful when writing scripts?

It helps you learn what an object can do and what information it holds. This guides you to write correct commands and avoid errors.

Click to reveal answer
What does Get-Member show about an object?
AIts properties and methods
BIts file size
CIts creation date
DIts content
Which command shows only methods of an object?
AGet-Member -MemberType Property
BGet-Item | Get-Member
CGet-Member -MemberType Method
DGet-Content
How do you inspect the properties of a file named example.txt?
AGet-Item example.txt | Get-Member
BGet-File example.txt
CGet-ChildItem example.txt
DGet-Content example.txt | Get-Member
Which of these is NOT shown by Get-Member?
AObject methods
BObject events
CObject properties
DObject content
Why might a beginner use Get-Member?
ATo delete files
BTo learn what commands work on an object
CTo open a file
DTo create a new object
Explain how Get-Member helps you understand a PowerShell object.
Think about what you want to know about an object before using it.
You got /4 concepts.
    Describe how to use Get-Member to find only the methods of a file object.
    Combine commands and use filtering options.
    You got /3 concepts.