Bird
0
0

You want to install multiple modules Az.Accounts and Az.Compute in one command. Which is the correct way?

hard📝 Application Q9 of 15
PowerShell - Modules and Script Organization
You want to install multiple modules Az.Accounts and Az.Compute in one command. Which is the correct way?
AInstall-Module -Name 'Az.Accounts Az.Compute' -Scope CurrentUser
BInstall-Module -Name @(Az.Accounts,Az.Compute) -Scope CurrentUser
CInstall-Module -Name Az.Accounts,Az.Compute -Scope CurrentUser
DInstall-Module -Name Az.Accounts -Module Az.Compute -Scope CurrentUser
Step-by-Step Solution
Solution:
  1. Step 1: Understand parameter accepts multiple names

    -Name can accept an array or comma-separated list of module names.
  2. Step 2: Validate syntax options

    Install-Module -Name Az.Accounts,Az.Compute -Scope CurrentUser uses comma-separated names which is valid syntax.
  3. Final Answer:

    Install-Module -Name Az.Accounts,Az.Compute -Scope CurrentUser -> Option C
  4. Quick Check:

    Use comma-separated list for multiple modules [OK]
Quick Trick: Separate multiple module names with commas in -Name [OK]
Common Mistakes:
  • Passing names as a single string with spaces
  • Using multiple -Name parameters (invalid)
  • Using array syntax without @() in PowerShell 7+

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes