Bird
0
0

You want to import a module from a specific folder path C:\CustomModules\MyModule. Which command correctly imports it?

hard📝 Application Q8 of 15
PowerShell - Modules and Script Organization
You want to import a module from a specific folder path C:\CustomModules\MyModule. Which command correctly imports it?
AImport-Module -Name C:\CustomModules\MyModule
BImport-Module C:\CustomModules\MyModule.psd1
CImport-Module -File C:\CustomModules\MyModule
DImport-Module -Path C:\CustomModules\MyModule
Step-by-Step Solution
Solution:
  1. Step 1: Understand Import-Module parameters

    To import a module by file path, use the -Path parameter.
  2. Step 2: Analyze options

    -Name expects a module name, not a path; positional with .psd1 directly is valid; -File is not a valid parameter for Import-Module.
  3. Final Answer:

    Import-Module -Path C:\CustomModules\MyModule -> Option D
  4. Quick Check:

    Use -Path to import module from folder path [OK]
Quick Trick: Use -Path to import module from a folder location [OK]
Common Mistakes:
  • Using -Name with a file path
  • Using invalid parameters like -File
  • Omitting parameter name when path is given

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes