0
0
PowerShellscripting~20 mins

PowerShell Gallery - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
PowerShell Gallery Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of listing installed modules?
You run the command Get-InstalledModule in PowerShell. What output do you expect if you have the module 'Pester' version 5.3.1 installed?
PowerShell
Get-InstalledModule
A
Name Version
---- -------
Pester 5.3.1
BPester 5.3.1
CNo output unless you specify -AllVersions
D
Name Version Repository
---- ------- ----------
Pester 5.3.1 PSGallery
Attempts:
2 left
💡 Hint
Think about the default properties shown by Get-InstalledModule.
💻 Command Output
intermediate
2:00remaining
What happens when you install a module twice?
You run Install-Module -Name Pester -Force twice in a row. What is the expected output or behavior?
PowerShell
Install-Module -Name Pester -Force
Install-Module -Name Pester -Force
AAn error occurs on the second command saying module already installed.
BThe module is installed once, second command overwrites without error.
CBoth commands install separate copies of the module side by side.
DThe second command prompts to confirm overwriting the module.
Attempts:
2 left
💡 Hint
The -Force parameter forces reinstallation without prompts or errors.
🚀 Application
advanced
2:00remaining
How to find the latest version of a module in PowerShell Gallery?
You want to find the latest available version of the module 'Pester' from the PowerShell Gallery without installing it. Which command will give you this information?
AFind-Module -Name Pester | Select-Object -Property Name, Version
BGet-InstalledModule -Name Pester | Select-Object -Property Name, Version
CInstall-Module -Name Pester -WhatIf
DSave-Module -Name Pester -Path .
Attempts:
2 left
💡 Hint
Find-Module searches the gallery without installing.
🔧 Debug
advanced
2:00remaining
Why does this Install-Module command fail with 'Access Denied'?
You run Install-Module -Name Pester in PowerShell and get an 'Access Denied' error. What is the most likely cause?
AThe module name 'Pester' is misspelled.
BPowerShell Gallery is offline or unreachable.
CYou are running PowerShell without administrator rights and trying to install to a system-wide location.
DYou have already installed the module.
Attempts:
2 left
💡 Hint
Installing modules system-wide requires admin rights.
🧠 Conceptual
expert
2:00remaining
What is the purpose of the PowerShell Gallery repository?
Which statement best describes the PowerShell Gallery repository?
AIt is an online repository where PowerShell modules and scripts are published and shared for easy discovery and installation.
BIt is a local folder on your computer where PowerShell stores installed modules.
CIt is a command-line tool to create PowerShell modules.
DIt is a security feature that blocks untrusted scripts from running.
Attempts:
2 left
💡 Hint
Think about where you get modules from when you use Install-Module.