Bird
0
0

Which of the following is the correct syntax to install a module named Az for the current user only?

easy📝 Syntax Q12 of 15
PowerShell - Modules and Script Organization
Which of the following is the correct syntax to install a module named Az for the current user only?
AInstall-Module Az -User
BInstall-Module -Name Az -UserScope
CInstall-Module -Name Az -Scope CurrentUser
DInstall-Module -Module Az -Scope User
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter for scope

    The correct parameter to specify installation scope is -Scope with values like CurrentUser or AllUsers.
  2. Step 2: Match correct syntax for module name and scope

    The module name is passed with -Name. So the correct syntax is Install-Module -Name Az -Scope CurrentUser.
  3. Final Answer:

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

    Use -Scope CurrentUser to install for current user [OK]
Quick Trick: Use -Scope CurrentUser to install module for yourself only [OK]
Common Mistakes:
  • Using incorrect parameter names like -UserScope or -User
  • Omitting -Name parameter
  • Using wrong values for -Scope

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes