Home > database >  Difference between Set-WebConfiguration and Set-WebConfigurationProperty cmdlets
Difference between Set-WebConfiguration and Set-WebConfigurationProperty cmdlets

Time:09-05

I am trying to automate creation/modify of application and virtual directory with authentication and ssl setting flags using powershell. However, I find Set-WebConfiguration and Set-WebConfigurationProperty cmdlets confusing. I didn't find much details in microsoft docs. Please anyone can suggest if there is any difference in usage of both cmdlets? Or I can use both of those interchangeably?

CodePudding user response:

Unfortunately, I don't know much about powershell. But based on their documentation, I don't think they are the same thing.

First of all, the introduction to the documentation already shows that they apply to different objects: element and property of IIS Configuration.

And the former (Set-WebConfigurationProperty) supports and uses wildcards, while the latter (Set-WebConfiguration) does not.

And they also contain different command parameters, like -AtElement, -AtIndex and AtName.

All that said, I think they should be used to implement different needs, and you need to differentiate between them.

CodePudding user response:

I was using cmdlets to set Ssl flags. One of the key difference is that Set-WebConfiguration auto-generate parent element if those are missing. However, Set-WebConfigurationProperty doesn't perform that.

  • Related