Challenge - 5 Problems
Report Automation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of CSV report generation script
What is the output of this PowerShell script that generates a CSV report from a list of users?
PowerShell
$users = @(
@{Name='Alice'; Age=30; Department='HR'},
@{Name='Bob'; Age=25; Department='IT'},
@{Name='Charlie'; Age=35; Department='Finance'}
)
$users | Export-Csv -Path 'report.csv' -NoTypeInformation
Get-Content 'report.csv' | Select-Object -First 3Attempts:
2 left
💡 Hint
Think about how Export-Csv formats the output with quotes and commas.
✗ Incorrect
Export-Csv outputs CSV with quoted headers and values by default. The -NoTypeInformation removes type info but quotes remain.
📝 Syntax
intermediate2:00remaining
Correct syntax for filtering report data
Which option correctly filters a list of processes to include only those with CPU usage greater than 10 and exports to a CSV report?
Attempts:
2 left
💡 Hint
Remember the correct cmdlet and syntax for filtering objects in PowerShell.
✗ Incorrect
Where-Object with script block { $_.CPU -gt 10 } is the correct syntax. Other options have wrong cmdlet names or syntax errors.
🔧 Debug
advanced2:00remaining
Identify the error in report generation script
What error will this script produce when run, and why?
$services = Get-Service
$services | Where-Object Status -eq 'Running' | Export-Csv -Path 'running_services.csv' -NoTypeInformation
PowerShell
$services = Get-Service $services | Where-Object Status -eq 'Running' | Export-Csv -Path 'running_services.csv' -NoTypeInformation
Attempts:
2 left
💡 Hint
Check the syntax of Where-Object usage.
✗ Incorrect
Where-Object requires a script block { } for conditions. Writing 'Where-Object Status -eq 'Running'' is invalid syntax.
🚀 Application
advanced2:00remaining
Automate report generation with date-stamped filename
Which script correctly generates a report of disk usage and saves it with a filename including the current date in YYYY-MM-DD format?
Attempts:
2 left
💡 Hint
Check date format and variable interpolation in strings.
✗ Incorrect
Option A uses correct date format and double quotes for variable expansion in filename. Others have wrong format or no variable expansion.
🧠 Conceptual
expert2:00remaining
Understanding pipeline behavior in report automation
In a PowerShell script that generates a report, what happens if you place Export-Csv before filtering the data with Where-Object in the pipeline?
Attempts:
2 left
💡 Hint
Think about how pipelines process commands in order.
✗ Incorrect
PowerShell pipelines process commands left to right. Export-Csv outputs data at that point, so filtering after it does not affect the CSV content.