0
0
PowerShellscripting~5 mins

Installing modules (Install-Module) in PowerShell - Quick Revision & Summary

Choose your learning style9 modes available
Recall & Review
beginner
What does the PowerShell command Install-Module do?
It downloads and installs a PowerShell module from an online repository like the PowerShell Gallery, making new commands available to use.
Click to reveal answer
beginner
How do you install a module named Az using Install-Module?
You run Install-Module -Name Az. This tells PowerShell to get the 'Az' module and install it on your system.
Click to reveal answer
intermediate
Why might you need to run PowerShell as Administrator when using Install-Module?
Installing modules system-wide often requires admin rights to write files in protected folders. Running as Administrator avoids permission errors.
Click to reveal answer
intermediate
What does the -Scope CurrentUser parameter do in Install-Module?
It installs the module only for the current user, avoiding the need for admin rights and keeping the module in the user's profile folder.
Click to reveal answer
intermediate
How can you check if a module is already installed before running Install-Module?
Use Get-Module -ListAvailable -Name ModuleName. If it returns results, the module is installed.
Click to reveal answer
What is the default repository used by Install-Module to get modules?
AGitHub
BPowerShell Gallery
CMicrosoft Store
DNuGet Gallery
Which parameter installs a module only for the current user?
A-Scope CurrentUser
B-UserOnly
C-InstallForUser
D-Local
If you get a permission error when running Install-Module, what should you try?
AUse <code>-Force</code> parameter
BRestart your computer
CUninstall other modules first
DRun PowerShell as Administrator
How do you install a specific version of a module?
A<code>Install-Module -Name ModuleName -SpecificVersion 1.2.3</code>
B<code>Install-Module -Module ModuleName -Ver 1.2.3</code>
C<code>Install-Module -Name ModuleName -Version 1.2.3</code>
D<code>Install-Module ModuleName 1.2.3</code>
Which command checks if a module is installed?
A<code>Get-Module -ListAvailable -Name ModuleName</code>
B<code>Check-Module ModuleName</code>
C<code>Find-Module ModuleName</code>
D<code>Show-Module ModuleName</code>
Explain how to install a PowerShell module for just your user account and why you might want to do that.
Think about permissions and where modules are stored.
You got /4 concepts.
    Describe the steps to check if a module is installed and then install it if missing.
    First look, then install if needed.
    You got /4 concepts.