Bird
0
0

Why does Get-Command sometimes return multiple commands with the same name?

hard📝 Conceptual Q10 of 15
PowerShell - Basics and Environment
Why does Get-Command sometimes return multiple commands with the same name?
ABecause Get-Command lists commands from all users on the system
BBecause Get-Command caches old commands and shows duplicates
CBecause the command is duplicated in the same module
DBecause commands can exist as aliases, functions, and cmdlets simultaneously
Step-by-Step Solution
Solution:
  1. Step 1: Understand command types in PowerShell

    A command name can be used by different command types like alias, function, and cmdlet at the same time.
  2. Step 2: Check other options

    Get-Command does not list by user, modules do not duplicate commands with same name, and it does not cache duplicates.
  3. Final Answer:

    Because commands can exist as aliases, functions, and cmdlets simultaneously -> Option D
  4. Quick Check:

    Multiple command types share names causing multiple results [OK]
Quick Trick: Same name can be alias, function, and cmdlet simultaneously [OK]
Common Mistakes:
  • Thinking duplicates are errors
  • Assuming module duplicates commands
  • Believing Get-Command caches duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes