Home Dashboard Directory Help
Search

$ErrorActionPreference=stop breaks Restore-WebConfiguration by Blindrood


Status: 

Active


4
0
Sign in
to vote
Type: Bug
ID: 770587
Opened: 11/9/2012 3:36:26 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

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)
Details
Sign in to post a comment.
Posted by Blindrood on 6/25/2014 at 2:14 AM
Windows Server 2012 R2 -> problem still exists
Sign in to post a workaround.
Posted by Blindrood on 11/9/2012 at 3:39 AM
1. Temporarily change erroractionpreference to 'continue' or 'silentlycontinue'