views:

10

answers:

1

On one of my servers the command New-WebSite stopped working today (it was working fine yesterday), throwing the exception "Index was outside the bounds of the array".

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

Does anyone know what might have caused this?

A: 

Found the problem. Apparently there must be at least one site configured in IIS otherwise this happens.

Peter Moberg