0
0
PowerShellscripting~20 mins

Get-Member for object inspection in PowerShell - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
PowerShell Object Inspector
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output type of Get-Member?
You run the command Get-Process | Get-Member. What type of information does Get-Member display?
PowerShell
Get-Process | Get-Member
AThe CPU usage percentage of each process
BThe memory usage of each process
CA list of properties and methods of the process objects
DThe full list of running processes with detailed info
Attempts:
2 left
💡 Hint
Think about what Get-Member does to objects piped into it.
💻 Command Output
intermediate
2:00remaining
What does this command output?
What is the output of this command?
'Hello World' | Get-Member
PowerShell
'Hello World' | Get-Member
AA list of all commands available in PowerShell
BThe string 'Hello World' printed again
CAn error saying Get-Member cannot process strings
DProperties and methods of the System.String object
Attempts:
2 left
💡 Hint
What type is a text string in PowerShell?
📝 Syntax
advanced
2:00remaining
Which command correctly shows only properties of an object?
You want to see only the properties of a service object. Which command is correct?
AGet-Service | Get-Member -MemberType Property
BGet-Service | Get-Member -Type Property
CGet-Service | Get-Member -Only Properties
DGet-Service | Get-Member -Member Properties
Attempts:
2 left
💡 Hint
Check the exact parameter name for filtering member types.
🔧 Debug
advanced
2:00remaining
Why does this command fail?
You run this command:
Get-Process | Get-Member -MemberType Methods
But it returns an error. Why?
PowerShell
Get-Process | Get-Member -MemberType Methods
ABecause the correct value is 'Method' not 'Methods'
BBecause Get-Member does not accept the -MemberType parameter
CBecause Get-Process does not output objects with methods
DBecause Get-Process must be run with admin rights
Attempts:
2 left
💡 Hint
Check the exact spelling of the parameter value.
🚀 Application
expert
3:00remaining
How to list only script methods of a custom object?
You have a custom object with script methods and properties. Which command lists only the script methods?
PowerShell
$obj = [PSCustomObject]@{Name='Test'; GetInfo={"Info"}}
A$obj | Get-Member -MemberType Method
B$obj | Get-Member -MemberType ScriptMethod
C$obj | Get-Member -MemberType ScriptProperty
D$obj | Get-Member -MemberType Property
Attempts:
2 left
💡 Hint
Script methods are different from normal methods and properties.