Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我们如何使用cmd为已经安装了IIS的Win2k12计算机启用所有功能_Iis_Powershell_Cmd_Windows Server 2012_Iis 8 - Fatal编程技术网

我们如何使用cmd为已经安装了IIS的Win2k12计算机启用所有功能

我们如何使用cmd为已经安装了IIS的Win2k12计算机启用所有功能,iis,powershell,cmd,windows-server-2012,iis-8,Iis,Powershell,Cmd,Windows Server 2012,Iis 8,对于Win2K8机器,我们安装IIS并使用命令启用所有功能 ServerManagerCmd.exe -install Web-Server -allSubFeatures -resultPath C:\Admin\WebServer.xml -restart 如果已经使用cmd安装了IIS,我们如何为Win2k12计算机启用所有功能?我个人使用这个: 获取窗口功能|?{$\名称-匹配“^Web-”}安装WindowsFeature 在Powershell 2.0上不起作用 安装内容: Get

对于Win2K8机器,我们安装IIS并使用命令启用所有功能

ServerManagerCmd.exe -install Web-Server -allSubFeatures -resultPath C:\Admin\WebServer.xml -restart
如果已经使用cmd安装了IIS,我们如何为Win2k12计算机启用所有功能?

我个人使用这个:

获取窗口功能|?{$\名称-匹配“^Web-”}安装WindowsFeature

在Powershell 2.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
未安装的内容:

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
安装未安装的内容:

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参数。

从cmd中找到Dism/online/Enable-Feature/FeatureName:Hearts。但我仍然想应用多个特性。当前正在查找选项如果要从cmd.exe运行它,则必须在上述命令之前键入单词powershell:
powershell Get WindowsFeature |?{$\ Name-match“^Web-”}安装WindowsFeature
这是如何回答问题的,它不会测试
IIS已经安装在哪里?
对我来说,这似乎会在所有机器上安装所有功能,而不管IIS是否存在,这可能不是OP的意图(或者我遗漏了什么)我想他是说IIS已经使用CMD安装在机器上,他想知道以后如何添加所有功能。我假设他最初使用的命令不允许他在安装后添加更多。是的,正确的IIS已经安装,唯一缺少的是默认情况下未启用某些功能。