Bird
0
0

You want to import multiple modules ModuleA and ModuleB in one command. Which is the correct way?

hard📝 Application Q9 of 15
PowerShell - Modules and Script Organization
You want to import multiple modules ModuleA and ModuleB in one command. Which is the correct way?
AImport-Module ModuleA.psm1 ModuleB
BImport-Module -Name ModuleA.psm1,ModuleB
CImport-Module ModuleA, ModuleB
DImport-Module -Name ModuleA.psm1, ModuleB
Step-by-Step Solution
Solution:
  1. Step 1: Understand Import-Module multiple modules syntax

    You can specify multiple module names separated by commas without parameters.
  2. Step 2: Analyze options

    The distractors include .psm1 extensions in module names, causing PowerShell to search for non-existent modules; the correct syntax uses plain names separated by commas.
  3. Final Answer:

    Import-Module ModuleA, ModuleB -> Option C
  4. Quick Check:

    Multiple modules imported by comma-separated names [OK]
Quick Trick: Separate multiple module names with commas in Import-Module [OK]
Common Mistakes:
  • Omitting commas between module names
  • Adding .psm1 extensions to module names
  • Trying to import modules without commas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes