Challenge - 5 Problems
PowerShell Module Installer Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this PowerShell command?
You run the command
Install-Module -Name Pester -Scope CurrentUser -Force on a system where Pester is already installed for the current user. What will happen?PowerShell
Install-Module -Name Pester -Scope CurrentUser -Force
Attempts:
2 left
💡 Hint
Think about what the -Force parameter does in Install-Module.
✗ Incorrect
The -Force parameter forces the installation even if the module is already installed, without prompting for confirmation.
💻 Command Output
intermediate2:00remaining
What error does this command produce?
You run
Install-Module -Name NonExistentModule on a system connected to the internet. What error will PowerShell show?PowerShell
Install-Module -Name NonExistentModule
Attempts:
2 left
💡 Hint
Consider what happens when a module name does not exist in the repository.
✗ Incorrect
PowerShell reports that no match was found for the module name if it does not exist in the repository.
📝 Syntax
advanced2:00remaining
Which command correctly installs a module for all users without prompts?
Choose the correct PowerShell command to install the module 'Az' for all users and suppress any confirmation prompts.
Attempts:
2 left
💡 Hint
Think about the scope parameter and how to suppress prompts.
✗ Incorrect
The -Scope AllUsers installs the module for all users, and -Force suppresses confirmation prompts.
🚀 Application
advanced2:00remaining
How to install a module from a specific repository?
You want to install the module 'PSReadLine' from the repository named 'MyRepo'. Which command will do this correctly?
Attempts:
2 left
💡 Hint
Check the parameter name for specifying the repository in Install-Module.
✗ Incorrect
The correct parameter to specify the repository is -Repository.
🔧 Debug
expert3:00remaining
Why does this Install-Module command fail with an error?
You run the command
Install-Module -Name AzureAD -Scope AllUsers but get an error saying you do not have permission to install for all users. What is the most likely cause?PowerShell
Install-Module -Name AzureAD -Scope AllUsers
Attempts:
2 left
💡 Hint
Think about permissions required for system-wide changes.
✗ Incorrect
Installing modules for all users requires administrator privileges, so PowerShell must be run as Administrator.