$ErrorActionPreference=stop breaks Restore-WebConfiguration - by Blindrood

Status : 


Sign in
to vote
ID 770587 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 11/9/2012 3:36:26 AM
Access Restriction Public


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)
Sign in to post a comment.
Posted by Blindrood on 6/25/2014 at 2:14 AM
Windows Server 2012 R2 -> problem still exists