Challenge - 5 Problems
Automation Time Saver Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this PowerShell script?
This script measures how long it takes to run a loop 5 times. What will it print?
PowerShell
Measure-Command {for ($i=1; $i -le 5; $i++) {Start-Sleep -Seconds 1}} | Select-Object TotalSecondsAttempts:
2 left
💡 Hint
Think about how long each loop iteration sleeps.
✗ Incorrect
The loop runs 5 times, each sleeping 1 second, so total time is about 5 seconds.
🧠 Conceptual
intermediate1:30remaining
Why does automation save time in repetitive tasks?
Choose the best reason why automation helps save time when doing repetitive tasks.
Attempts:
2 left
💡 Hint
Think about how machines work compared to humans.
✗ Incorrect
Automation runs tasks quickly and consistently without needing rest, saving time.
🔧 Debug
advanced2:30remaining
Identify the error in this PowerShell automation script
This script is supposed to rename all .txt files to .bak files in a folder. What error will it cause?
PowerShell
Get-ChildItem -Path . -Filter *.txt | Rename-Item -NewName { $_.Name -replace '.txt', '.bak' }Attempts:
2 left
💡 Hint
Check how Rename-Item uses script blocks for -NewName.
✗ Incorrect
The script correctly uses a script block to replace '.txt' with '.bak' in file names.
🚀 Application
advanced2:30remaining
How does this automation script save time?
This script backs up a folder every day automatically. How does it save time compared to manual backup?
PowerShell
if (-not (Test-Path C:\Backup)) { New-Item -ItemType Directory -Path C:\Backup }
Copy-Item -Path C:\Data\* -Destination C:\Backup -RecurseAttempts:
2 left
💡 Hint
Think about what automation means for repetitive tasks.
✗ Incorrect
Automation runs backups without user intervention, saving time and avoiding forgetfulness.
📝 Syntax
expert3:00remaining
Which PowerShell command correctly automates deleting files older than 30 days?
Select the command that deletes files older than 30 days in C:\Logs folder.
Attempts:
2 left
💡 Hint
Files older than 30 days have LastWriteTime less than today minus 30 days.
✗ Incorrect
Option C correctly filters files older than 30 days and pipes them to Remove-Item.