0
0
PowerShellscripting~10 mins

PowerShell Gallery - Interactive Code Practice

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

Complete the code to install a module from the PowerShell Gallery.

PowerShell
Install-Module -Name [1]
Drag options to blanks, or click blank then click option'
AGet-Process
BNew-Item
CAzureAD
DSet-Location
Attempts:
3 left
💡 Hint
Common Mistakes
Using a cmdlet name instead of a module name.
Leaving the module name blank.
2fill in blank
medium

Complete the code to find modules related to 'Azure' in the PowerShell Gallery.

PowerShell
Find-Module -Name [1]
Drag options to blanks, or click blank then click option'
A*Azure*
BAzureAD
CGet-Azure
DAzure
Attempts:
3 left
💡 Hint
Common Mistakes
Searching for exact module names only.
Not using quotes around the search pattern.
3fill in blank
hard

Fix the error in the code to update a module from the PowerShell Gallery.

PowerShell
Update-Module -Name [1]
Drag options to blanks, or click blank then click option'
AGet-Process
BSet-Location
CNew-Item
DAzureAD
Attempts:
3 left
💡 Hint
Common Mistakes
Using cmdlet names instead of module names.
Trying to update modules not installed.
4fill in blank
hard

Fill both blanks to save a module to a specific path and then import it.

PowerShell
Save-Module -Name [1] -Path [2]
Import-Module -Name [1]
Drag options to blanks, or click blank then click option'
AAzureAD
BC:\\Modules
CD:\\PowerShellModules
DGet-Process
Attempts:
3 left
💡 Hint
Common Mistakes
Using cmdlet names instead of module names.
Using invalid or missing folder paths.
5fill in blank
hard

Fill all three blanks to create a script that installs a module if not already installed.

PowerShell
if (-not (Get-Module -ListAvailable -Name [1])) {
    [2] -Name [1] -Force
}
Import-Module -Name [3]
Drag options to blanks, or click blank then click option'
AAzureAD
BInstall-Module
CAzureADPreview
DUpdate-Module
Attempts:
3 left
💡 Hint
Common Mistakes
Using different module names for check and import.
Using Update-Module instead of Install-Module for installation.