iis - "PS c:\> New-WebSite -Blah:"抛出索引超出数组范围

标签 iis iis-7 powershell

在我的一台服务器上,命令 New-WebSite 今天停止工作(昨天工作正常),抛出异常“索引超出数组范围”。

PS C:\Windows\system32> Import-Module WebAdministration
PS C:\Windows\system32> New-WebSite -Blah
New-Item : Index was outside the bounds of the array.
    + CategoryInfo          : NotSpecified: (:) [New-Item], IndexOutOfRangeException
    + FullyQualifiedErrorId : System.IndexOutOfRangeException,Microsoft.PowerShell.Commands.NewItemCommand

有谁知道这是什么原因造成的吗?

最佳答案

这是 New-WebSite commandlet 中的错误。显然,IIS 中必须至少配置一个站点,否则 New-WebSite 会崩溃。

关于iis - "PS c:\> New-WebSite -Blah:"抛出索引超出数组范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3573889/

相关文章:

从 Cassini 开发服务器更改为 IIS 7.5 Express 导致 ASP.NET 中的 Javascript 错误

javascript - WIX:我的 CustomAction 应该在哪里以及如何创建和读取临时文件?

asp.net - PipelineStepManager.ResumeSteps中的NullReferenceException

powershell - 比较新的时间跨度总时间..未按预期运行

powershell - Gradle -v 命令指向旧版本

PHP fopen 权限被拒绝 - Windows Server 远程

asp.net-mvc - asp.net mvc没有收到带有句点的GET请求

asp.net - 将 IIS7 url 重写部分移出 web.config 文件

powershell - 检查变量是否是字符串列表/数组?

IIS 7.0 多域站点绑定(bind)