Bird
0
0

You have a binary module that exports cmdlets with the same names as functions in a script module. How does PowerShell resolve command conflicts when both modules are imported?

hard📝 Application Q9 of 15
PowerShell - Modules and Script Organization
You have a binary module that exports cmdlets with the same names as functions in a script module. How does PowerShell resolve command conflicts when both modules are imported?
ABoth commands are available and PowerShell randomly chooses one.
BThe last imported module's commands override previous ones.
CPowerShell throws an error and refuses to import the second module.
DPowerShell merges commands and runs both simultaneously.
Step-by-Step Solution
Solution:
  1. Step 1: Understand command resolution

    When commands conflict, PowerShell uses the last imported module's commands.
  2. Step 2: Confirm behavior on import order

    Importing a module later overrides commands with the same name from earlier modules.
  3. Final Answer:

    The last imported module's commands override previous ones. -> Option B
  4. Quick Check:

    Command conflict resolution = C [OK]
Quick Trick: Last imported module wins command name conflicts. [OK]
Common Mistakes:
  • Expecting errors on conflicts
  • Assuming random command selection
  • Thinking commands merge automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes