Bird
0
0

This command fails:

medium📝 Debug Q7 of 15
PowerShell - System Administration
This command fails:
Remove-Item -Path 'HKCU:\Software\MyApp\Settings' -Recurse

What is a possible reason?
ARemove-Item cannot delete registry keys
BThe key 'Settings' does not exist
CThe -Recurse parameter is invalid for registry paths
DYou must use Remove-ItemProperty to delete keys
Step-by-Step Solution
Solution:
  1. Step 1: Understand Remove-Item usage

    Remove-Item can delete registry keys with -Recurse to remove subkeys.
  2. Step 2: Identify failure cause

    If the key does not exist, the command fails with an error.
  3. Final Answer:

    The key 'Settings' does not exist -> Option B
  4. Quick Check:

    Nonexistent key causes Remove-Item failure [OK]
Quick Trick: Check key existence before Remove-Item with -Recurse [OK]
Common Mistakes:
  • Thinking Remove-Item can't delete keys
  • Believing -Recurse is invalid
  • Confusing Remove-ItemProperty with Remove-Item

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes