2014-01-16 33 views

回答

1

我個人使用:

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

不能在PowerShell 2.0中

+0

找到了Dism/online/Enable-Feature/FeatureName:來自cmd的紅心。但我仍然想要應用多個功能。尋找選項目前 – StackOverflowVeryHelpful

+0

我發佈的命令將安裝每個Web服務器功能 –

+0

是否有任何命令直接從cmd運行此命令? – StackOverflowVeryHelpful

0

的工作是安裝什麼:

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

什麼是未安裝的:

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

安裝什麼不安裝:

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

我使用-WhatIf通用參數上的最後一個,並得到一個警告約需要一個安裝源。您可能需要研究Install-WindowsFeature cmdlet的-Source參數。

相關問題