0
0
PowerShellscripting~10 mins

Registry operations in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to read the value of a registry key.

PowerShell
Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' | Select-Object -Property [1]
Drag options to blanks, or click blank then click option'
ARemove-Item
BShell Folders
CNew-Item
DGet-Item
Attempts:
3 left
💡 Hint
Common Mistakes
Using cmdlets like Get-Item instead of property names.
Trying to use Remove-Item which deletes keys instead of reading.
2fill in blank
medium

Complete the code to create a new registry key.

PowerShell
New-Item -Path 'HKCU:\Software\MyApp' -Name [1] -Force
Drag options to blanks, or click blank then click option'
ASettings
BGet-Item
CRemove-Item
DSet-ItemProperty
Attempts:
3 left
💡 Hint
Common Mistakes
Using cmdlets like Get-Item or Remove-Item as the name.
Omitting the name parameter or giving an invalid value.
3fill in blank
hard

Fix the error in the code to set a registry value.

PowerShell
Set-ItemProperty -Path 'HKCU:\Software\MyApp\Settings' -Name [1] -Value 'Enabled'
Drag options to blanks, or click blank then click option'
AStatus
BGet-Item
CNew-Item
DRemove-Item
Attempts:
3 left
💡 Hint
Common Mistakes
Using cmdlets like Get-Item or New-Item instead of a value name.
Confusing the key name with the value name.
4fill in blank
hard

Fill both blanks to delete a registry value safely.

PowerShell
Remove-ItemProperty -Path 'HKCU:\Software\MyApp\Settings' -Name [1] -ErrorAction [2]
Drag options to blanks, or click blank then click option'
AStatus
BSilentlyContinue
CStop
DVerbose
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect value names or error actions that stop the script.
Omitting error handling causing script to fail if value missing.
5fill in blank
hard

Fill all three blanks to list all subkeys under a registry path.

PowerShell
$keys = Get-ChildItem -Path [1] | ForEach-Object { $_.[2] } ; $keys | Where-Object { $_ -like [3] }
Drag options to blanks, or click blank then click option'
A'HKCU:\Software\MyApp'
BName
C'*Settings*'
DValue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Value' instead of 'Name' to get subkey names.
Incorrect path or filter pattern causing no results.