Challenge - 5 Problems
PowerShell Object Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output type of this PowerShell command?
Consider the following PowerShell command:
What type of object does this command output?
Get-Process | Select-Object -First 1
What type of object does this command output?
PowerShell
Get-Process | Select-Object -First 1 | Get-Member -MemberType PropertyAttempts:
2 left
💡 Hint
Think about what Get-Process returns and how PowerShell treats output.
✗ Incorrect
PowerShell commands output objects, not just text. Get-Process returns process objects with properties like Id, Name, CPU, etc.
🧠 Conceptual
intermediate1:30remaining
Why does PowerShell treat output as objects?
Why does PowerShell output objects instead of plain text like many other shells?
Attempts:
2 left
💡 Hint
Think about how automation scripts benefit from structured data.
✗ Incorrect
Objects let scripts access detailed information easily, making automation more powerful and flexible.
🔧 Debug
advanced2:00remaining
Identify the error in this PowerShell pipeline
What error occurs when running this command?
Get-Process | Where-Object { $_.Name -eq 'notepad' } | Select-Object CPUPowerShell
Get-Process | Where-Object { $_.Name -eq 'notepad' } | Select-Object CPUAttempts:
2 left
💡 Hint
Check if the CPU property exists on process objects.
✗ Incorrect
The CPU property exists on process objects, so the command runs without error and outputs CPU usage of notepad processes.
🚀 Application
advanced2:00remaining
Extracting object properties in PowerShell
You want to list the names and IDs of all running processes. Which command produces the correct output?
Attempts:
2 left
💡 Hint
Select-Object extracts properties as objects; Format-Table formats output but does not produce objects.
✗ Incorrect
Select-Object extracts specified properties as objects, which can be further processed or displayed.
📝 Syntax
expert2:30remaining
What is the output of this PowerShell object method call?
Given this code:
What is the output?
$proc = Get-Process -Id $PID
$proc.ToString()
What is the output?
Attempts:
2 left
💡 Hint
Process class overrides ToString() to return the ProcessName property.
✗ Incorrect
Process objects override the ToString() method to return the process name (e.g., 'pwsh' for PowerShell).