Challenge - 5 Problems
Registry Operations Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this PowerShell command?
Given the following command, what will it output if the registry key
HKCU:\Software\MyApp contains a string value Version set to 1.2.3?PowerShell
Get-ItemProperty -Path 'HKCU:\Software\MyApp' -Name Version | Select-Object -ExpandProperty VersionAttempts:
2 left
💡 Hint
The command extracts the value of the property named 'Version' from the registry key.
✗ Incorrect
The command gets the property 'Version' from the specified registry path and expands it to output only its value, which is '1.2.3'.
📝 Syntax
intermediate1:30remaining
Which option correctly creates a new registry key?
You want to create a new registry key
HKCU:\Software\MyApp\Settings. Which command is syntactically correct?Attempts:
2 left
💡 Hint
The cmdlet to create a new registry key is similar to creating a new item in a provider path.
✗ Incorrect
The correct cmdlet to create a new registry key is New-Item with the registry path. Other options are invalid or used for different purposes.
🔧 Debug
advanced2:00remaining
Why does this script fail to set a registry value?
This script tries to set a string value
Theme to Dark under HKCU:\Software\MyApp but fails with an error. What is the cause?
Set-ItemProperty -Path 'HKCU:\Software\MyApp' -Name Theme -Value Dark
Attempts:
2 left
💡 Hint
Check if the registry key exists before setting a property.
✗ Incorrect
If the registry key does not exist, Set-ItemProperty will fail because it cannot set a property on a non-existent key.
🚀 Application
advanced2:00remaining
How to delete a registry value safely?
You want to delete the registry value
Theme under HKCU:\Software\MyApp only if it exists. Which script snippet correctly does this?Attempts:
2 left
💡 Hint
Use error handling to avoid errors if the value does not exist.
✗ Incorrect
Option A deletes the value and suppresses errors if the value is missing, making it safe to run.
🧠 Conceptual
expert2:30remaining
What is the effect of this PowerShell script on the registry?
Consider this script:
$keyPath = 'HKCU:\Software\MyApp'
if (-not (Test-Path $keyPath)) {
New-Item -Path $keyPath | Out-Null
}
Set-ItemProperty -Path $keyPath -Name 'LastRun' -Value (Get-Date).ToString('yyyy-MM-dd')
What does this script do?Attempts:
2 left
💡 Hint
Check the logic: it tests for key existence, creates if missing, then sets a value.
✗ Incorrect
The script ensures the registry key exists, then sets a string value 'LastRun' with the current date formatted as yyyy-MM-dd.