0
0
PowerShellscripting~20 mins

Windows features management in PowerShell - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Windows Features Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Check the output of listing Windows features
What is the output of this PowerShell command when run on a Windows machine with IIS installed?
Get-WindowsFeature -Name Web-Server | Select-Object Name, InstallState
PowerShell
Get-WindowsFeature -Name Web-Server | Select-Object Name, InstallState
A
[Name] Web-Server
[InstallState] Disabled
B
[Name] Web-Server
[InstallState] Removed
C
[Name] Web-Server
[InstallState] Available
D
[Name] Web-Server
[InstallState] Installed
Attempts:
2 left
💡 Hint
Think about what 'InstallState' shows when a feature is installed.
📝 Syntax
intermediate
2:00remaining
Identify the correct syntax to install a Windows feature
Which PowerShell command correctly installs the Windows feature 'Telnet-Client'?
AAdd-WindowsFeature -Name Telnet-Client
BInstall-WindowsFeature -Name Telnet-Client
CEnable-WindowsFeature Telnet-Client
DInstall-WindowsFeature Telnet-Client
Attempts:
2 left
💡 Hint
Check the official parameter name for specifying the feature.
🔧 Debug
advanced
2:00remaining
Find the error in this feature removal script
This script is intended to remove the 'Telnet-Client' feature but fails with an error. What is the cause?
Remove-WindowsFeature Telnet-Client
PowerShell
Remove-WindowsFeature Telnet-Client
AThe cmdlet requires administrative privileges; running without admin causes failure.
BThe feature name must be passed with '-Name' parameter, so it should be 'Remove-WindowsFeature -Name Telnet-Client'.
CThe cmdlet 'Remove-WindowsFeature' does not exist; the correct cmdlet is 'Uninstall-WindowsFeature'.
DThe feature cannot be removed while in use; the script needs to stop dependent services first.
Attempts:
2 left
💡 Hint
Check the official cmdlet names for removing Windows features.
🚀 Application
advanced
3:00remaining
Script to check and install a feature if missing
You want a PowerShell script that checks if the 'Web-Server' feature is installed, and if not, installs it silently. Which script achieves this?
Aif ((Get-WindowsFeature -Name Web-Server).InstallState -ne 'Installed') { Install-WindowsFeature -Name Web-Server -IncludeManagementTools -Restart:$false }
Bif ((Get-WindowsFeature Web-Server).InstallState -eq 'Available') { Install-WindowsFeature Web-Server }
Cif ((Get-WindowsFeature -Name Web-Server).InstallState -eq 'Removed') { Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature }
Dif ((Get-WindowsFeature -Name Web-Server).InstallState -ne 'Installed') { Install-WindowsFeature -Name Web-Server -IncludeManagementTools -Restart }
Attempts:
2 left
💡 Hint
Check the InstallState property and the parameters for silent install without restart.
🧠 Conceptual
expert
3:00remaining
Understanding feature states and their meanings
Which of the following correctly describes the meaning of the 'InstallState' values returned by 'Get-WindowsFeature'?
A'Installed' means the feature is active; 'Available' means it can be installed; 'Removed' means it is not installed but available; 'Disabled' means the feature is not installed and blocked from installation.
B'Installed' means the feature is active; 'Available' means it can be installed; 'Removed' means it is not present and cannot be installed; 'Disabled' means the feature is blocked.
C'Installed' means the feature is active; 'Available' means it is installed but inactive; 'Removed' means it is uninstalled; 'Disabled' means it is deprecated.
D'Installed' means the feature is active; 'Available' means it is deprecated; 'Removed' means it is active but hidden; 'Disabled' means it is inactive.
Attempts:
2 left
💡 Hint
Think about which states allow installation and which block it.