Bird
0
0

Why might configuration drift detection using Compare-Object miss some changes in complex nested configurations?

hard📝 Conceptual Q10 of 15
PowerShell - Automation Patterns
Why might configuration drift detection using Compare-Object miss some changes in complex nested configurations?
ABecause Compare-Object performs shallow comparison and may not detect nested property differences
BBecause Compare-Object only works with strings, not objects
CBecause Compare-Object requires manual input for each nested level
DBecause Compare-Object automatically corrects drift, hiding differences
Step-by-Step Solution
Solution:
  1. Step 1: Understand Compare-Object comparison depth

    Compare-Object compares top-level properties by default, not nested objects deeply.
  2. Step 2: Identify limitation in nested config detection

    It may miss differences inside nested properties unless explicitly handled.
  3. Final Answer:

    Because Compare-Object performs shallow comparison and may not detect nested property differences -> Option A
  4. Quick Check:

    Compare-Object shallow comparison misses nested differences = C [OK]
Quick Trick: Compare-Object is shallow; use custom logic for nested checks [OK]
Common Mistakes:
  • Thinking Compare-Object only works with strings
  • Assuming it auto-corrects drift
  • Believing manual input is always required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes