For a Win2K8 machine we install IIS and enable all features using the command

ServerManagerCmd.exe -install Web-Server -allSubFeatures -resultPath C:\Admin\WebServer.xml -restart

How do we enable all features for Win2k12 machine where IIS is already installed using cmd ?

有帮助吗?

解决方案

I personally use this:

Get-WindowsFeature | ? {$_.Name -match "^Web-"} | Install-WindowsFeature

Doesn't work on Powershell 2.0

其他提示

What is installed:

Get-WindowsFeature -Name Web* | where {$_.Installed -eq $True}

What is not installed:

Get-WindowsFeature -Name Web* | where {$_.Installed -eq $False}

Install what's not installed:

Get-WindowsFeature -Name Web* | where {$_.Installed -eq $False} | Install-WindowsFeature

I used the -WhatIf Common Parameter on the last one and got a warning about needing an install source. You may need to research the -Source parameter of Install-WindowsFeature cmdlet.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top