I'm trying to write a powershell scripts that activates all the features under
Web Server (IIS) > Web Server > Application Development
But for the life of me I can't find the syntax online. I've imported servermanager and even ran the code below to find a list of commands but can't seem to find exactly what I need.
Get-WindowsFeature |
Where-Object {$_.Installed -match “True”} |
Select-Object -ExpandProperty Name |
Write-Host
From the GUI here is what I'm looking for

EDIT
After some work with Get-WindowsFeature Web-Server I was able to find the Web-App-Dev command referenced the features I'm trying to install. However, not all of them are listed. After running the following command
Add-WindowsFeature Web-App-Dev
Only the following are installed

I've tried this "work around" however I get the same results. Does anyone know how to install every feature in the Application Development node?
$features = Get-WindowsFeature Web-App-Dev
$subFeatures = $features.SubFeatures
foreach($item in subFeatures)
{
Add-WindowsFeature $item
}
According to the documentation. Add-WindowsFeature can be used as an alias for Install-WindowsFeature after Windows Server 2008 R2. https://technet.microsoft.com/en-us/library/jj205467(v=wps.630).aspx
You can use the option IncludeAllSubFeature for that.
Install-WindowsFeature Web-App-Dev -IncludeAllSubFeature
Found it after some investigation using Get-WindowsFeature:
Web-App-Dev
To install all sub features I used this loop below
#install Web Server (IIS) > Web Server > Application Development settings
$features = Get-WindowsFeature Web-App-Dev
$subFeatures = $features.SubFeatures -split " "
foreach($item in $subFeatures)
{
Add-WindowsFeature $item
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With