문제

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