Bird
0
0

Why does this command fail?

medium📝 Debug Q7 of 15
PowerShell - Basics and Environment
Why does this command fail?
Get-Command -Module 'NonExistentModule'
AThe module name is incorrect or not loaded
BGet-Command does not support -Module parameter
CYou must specify -Name with -Module
DThe command syntax is missing a wildcard
Step-by-Step Solution
Solution:
  1. Step 1: Understand -Module parameter behavior

    If the module is not installed or loaded, Get-Command cannot find commands from it.
  2. Step 2: Check other options

    -Module is valid alone, -Name is optional, and wildcards are not required for module names.
  3. Final Answer:

    The module name is incorrect or not loaded -> Option A
  4. Quick Check:

    Module must exist and be loaded [OK]
Quick Trick: Ensure module is installed and imported before querying [OK]
Common Mistakes:
  • Assuming -Module is invalid
  • Thinking -Name is mandatory with -Module
  • Expecting wildcards for module names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes