Bird
0
0

Why is it important to use the -Recurse parameter with Remove-Item when deleting a registry key that has subkeys?

hard📝 Conceptual Q10 of 15
PowerShell - System Administration
Why is it important to use the -Recurse parameter with Remove-Item when deleting a registry key that has subkeys?
ABecause without -Recurse, Remove-Item will fail if the key has subkeys
BBecause -Recurse backs up the key before deleting
CBecause -Recurse only deletes values, not keys
DBecause -Recurse converts keys to values before deletion
Step-by-Step Solution
Solution:
  1. Step 1: Understand Remove-Item behavior

    Remove-Item cannot delete keys with subkeys unless -Recurse is specified.
  2. Step 2: Role of -Recurse

    -Recurse tells Remove-Item to delete all subkeys and values recursively.
  3. Final Answer:

    Because without -Recurse, Remove-Item will fail if the key has subkeys -> Option A
  4. Quick Check:

    -Recurse deletes subkeys recursively [OK]
Quick Trick: Use -Recurse to delete keys with subkeys [OK]
Common Mistakes:
  • Thinking -Recurse backs up keys
  • Believing it deletes only values
  • Assuming it converts keys to values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes