Recall & Review
beginner
What is the purpose of importing modules in PowerShell?
Importing modules in PowerShell allows you to add extra commands and functions that are not built into the default shell. It helps you reuse code and access new features easily.
Click to reveal answer
beginner
Which PowerShell command is used to import a module?The command
Import-Module is used to load a module into the current PowerShell session.Click to reveal answer
beginner
How do you check which modules are currently imported in your PowerShell session?
Use the command
Get-Module without parameters to see all modules currently loaded in your session.Click to reveal answer
beginner
What happens if you try to import a module that is not installed on your system?PowerShell will show an error saying it cannot find the module. You need to install the module first before importing it.
Click to reveal answer
intermediate
How can you import a module only if it is not already imported?You can use
Import-Module -Name ModuleName -ErrorAction SilentlyContinue or check with Get-Module before importing to avoid errors or duplicate imports.Click to reveal answer
Which command imports a module named 'Az' in PowerShell?
✗ Incorrect
The correct command to import a module is
Import-Module followed by the module name.What does the command
Get-Module show when run without parameters?✗ Incorrect
Get-Module without parameters lists modules currently loaded in the session.If a module is not installed, what will happen when you try to import it?
✗ Incorrect
PowerShell shows an error if the module is not found or installed.
How can you avoid errors when importing a module that might already be loaded?
✗ Incorrect
You can either suppress errors with
-ErrorAction SilentlyContinue or check with Get-Module before importing.What is a module in PowerShell?
✗ Incorrect
A module is a package that contains commands, functions, and other resources to extend PowerShell.
Explain how to import a module in PowerShell and how to check if it is already imported.
Think about commands to load and list modules.
You got /4 concepts.
Describe what happens if you try to import a module that is not installed and how to handle this situation.
Consider what PowerShell does when it can't find a module.
You got /3 concepts.