0
0
PowerShellscripting~10 mins

Importing modules in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the module named 'Az.Accounts'.

PowerShell
Import-Module [1]
Drag options to blanks, or click blank then click option'
AConnect-AzAccount
BGet-Module
CAz.Accounts
DNew-Module
Attempts:
3 left
💡 Hint
Common Mistakes
Using a cmdlet name instead of a module name.
Forgetting to specify the module name.
2fill in blank
medium

Complete the code to import the module 'Microsoft.PowerShell.Management' only if it is not already imported.

PowerShell
if (-not (Get-Module -Name [1])) { Import-Module [1] }
Drag options to blanks, or click blank then click option'
AMicrosoft.PowerShell.Management
BGet-Module
CImport-Module
DPowerShell
Attempts:
3 left
💡 Hint
Common Mistakes
Using a cmdlet name instead of the module name.
Using different names in the two places.
3fill in blank
hard

Fix the error in the code to import the module 'PSReadLine'.

PowerShell
Import-Module [1]
Drag options to blanks, or click blank then click option'
APSReadline
BPSReadLine
CPS_ReadLine
DReadLine
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the module name.
Using underscores or spaces incorrectly.
4fill in blank
hard

Fill both blanks to import the module 'Az.Compute' and force re-import even if already loaded.

PowerShell
Import-Module [1] -[2]
Drag options to blanks, or click blank then click option'
AAz.Compute
BForce
CRecurse
DVerbose
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong parameter names like -Recurse or -Verbose instead of -Force.
Misspelling the module name.
5fill in blank
hard

Fill all three blanks to import the module 'AzureAD' with the scope set to current user and suppress errors.

PowerShell
Import-Module [1] -Scope [2] -ErrorAction [3]
Drag options to blanks, or click blank then click option'
AAzureAD
BCurrentUser
CSilentlyContinue
DAllUsers
Attempts:
3 left
💡 Hint
Common Mistakes
Using AllUsers instead of CurrentUser for scope.
Not using SilentlyContinue to suppress errors.