WebAdministrationDsc icon indicating copy to clipboard operation
WebAdministrationDsc copied to clipboard

Support null value for ServiceAutoStartProvider property of xWebApplication

Open fredgate opened this issue 8 years ago • 6 comments

I open this pull request to follow my work to fix the issue #225.

The goal is that xWebApplication resource provide the avibility to remove ServiceAutoStartProvider already configured for a web application in IIS. I actually remove the property for the web application. Could I have a feedback (about logic, readability...) on the pushed commit ? I think that a unit test should be added to validate this case, but I don't know exactly what and how to do. Some help for this shoud be appreciate.

Surely should we also remove the provider of the web application from IIS's providers list if no other application references this provider. What do you think ?


This change is Reviewable

fredgate avatar Sep 08 '16 12:09 fredgate

Hi @fredgate - Yes, a unit test would be great. If you want to check out our TestGuidelines that should get you started. You can just add it in to the existing xWebApplication tests. Thanks!

mbreakey3 avatar Sep 08 '16 17:09 mbreakey3

Would be nice also to be able to clear /system.applicationHost/serviceAutoStartProviders as well but it's not really needed tbh

nzspambot avatar Jan 05 '17 00:01 nzspambot

Hi @fredgate are you still working on this? Happy to help if needed.

tysonjhayes avatar Jan 25 '17 22:01 tysonjhayes

Passing ServiceAutoStartProvider = $null will result in $PSBoundParameters.ContainsKey('ServiceAutoStartProvider') evaluating to $false. Adding the AllowNull() attribute doesn't work too, so I think we have to use another approach. May be empty string? Is passing an empty string to remove an item in compliance with the Powershell guidelines?

xWebApplication WebApp
{
    Name = "Foo"
    Ensure = "Present"
    Website = "Default Web Site"
    WebAppPool = "Foo"
    PhysicalPath = "c:\inetpub\foo"
    ServiceAutoStartEnabled = $false
    ServiceAutoStartProvider = ''
}

rosberglinhares avatar Apr 14 '17 00:04 rosberglinhares

@fredgate are you still able to work on this pull request? If so I can help you review it and get it merged. There are merge conflicts and we should have tests that test this scenario. If you can't work on this pull request, no worries, then I will label it as abandoned so that someone else can take over the work. 🙂

johlju avatar Apr 23 '18 10:04 johlju

Labeling this PR as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on the PR is taken up again.

johlju avatar May 23 '18 11:05 johlju