在 Windows Server 数据中心找不到 WebAdministration powershell 模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5963647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WebAdministration powershell module not found on windows server data center
提问by Jeevan
In Windows Server 2008 Datacenter, I could not find the PowerShell webadministration
module. I tried Get-PSSnapin
and Get-Module -ListAvailable
, neither of which showed webadministration
在 Windows Server 2008 Datacenter 中,我找不到 PowerShellwebadministration
模块。我试过Get-PSSnapin
和Get-Module -ListAvailable
,都没有显示webadministration
And I don't see the webadministration
module under the directory %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules
!!
而且我没有看到webadministration
目录下的模块%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules
!!
Do I need to install or enable something to have webadministration
on Datacenter ?
我需要webadministration
在 Datacenter 上安装或启用某些东西吗?
回答by ravikanth
You need to have web server role (IIS) installed. WebAdministration is a module. So, use Get-Module -ListAvailable
您需要安装 Web 服务器角色 (IIS)。WebAdministration 是一个模块。所以,使用Get-Module -ListAvailable
Also, looks like these cmdlets are available only on Windows Server 2008 R2 or with IIS 7.5. So, if you have IIS7.5 on Windows Server 2008, these cmdlets will be available.
此外,看起来这些 cmdlet 仅在 Windows Server 2008 R2 或 IIS 7.5 上可用。因此,如果您在 Windows Server 2008 上安装了 IIS7.5,则这些 cmdlet 将可用。
回答by Richard Nienaber
You can install the snapin. You can then use this scriptto load it.
回答by SliverNinja - MSFT
For automation with Windows Server 2008, We use WebPiCmdto push IISPowershellSnapin, then run Add-PSSnapin WebAdministration
to support IIS powershell integration. The IIS Administration Module is already present in Windows Server 2012by default.
对于Windows Server 2008 的自动化,我们使用WebPiCmd推送IISPowershellSnapin,然后运行Add-PSSnapin WebAdministration
以支持 IIS powershell 集成。默认情况下,IIS 管理模块已存在于Windows Server 2012 中。
Powershell - Support IIS Administration for Server 2008
Powershell - 支持 Server 2008 的 IIS 管理
.\WebpiCmd.exe /Install /Products:IISPowershellSnapin /AcceptEula /ForceReboot
Add-PSSnapin WebAdministration
Get-Website