Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell Web Server > Application Development settings

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

enter image description here

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

enter image description here

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
}
like image 385
NealR Avatar asked May 26 '26 07:05

NealR


2 Answers

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

like image 79
Ferran Arau Castell Avatar answered May 30 '26 04:05

Ferran Arau Castell


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
}
like image 30
NealR Avatar answered May 30 '26 03:05

NealR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!