When You set ErrorActionPreference to stop, You can't execute Restore-WebConfiguration.This is because Restore-Webconfiguration uses Get-Service to find IISAdmin service. Normally it will return null or this service object. But if Action preference is set to stop it will throw error that is not handled. Error doesn't appear if IISAdmin exists (if IIS6 Management compatibility is installed)
Have you seen this problem before in this product?
Please wait...