Fixing issue with win_iis_website parameter types. Issue #34500 (#34501)

* remidate Windows debugging

Using $complex_args is not working (anymore?). We need to set $params directly.

* Fixing issue with win_iis_website parameter types

There are two types of attributes. "String" and "Configuration Attribute". We need to get the real "value" based on the type.

* Revert "remidate Windows debugging"

This reverts commit df75d3bb0d.
This commit is contained in:
jn-bedag 2018-01-08 01:26:16 +01:00 committed by Jordan Borean
parent 49739dda47
commit 7f59f7d80e

View file

@ -150,8 +150,15 @@ Try {
# Set properties # Set properties
if($parameters) { if($parameters) {
$parameters | foreach { $parameters | foreach {
$parameter_value = Get-ItemProperty "IIS:\Sites\$($site.Name)" $_[0] $property_value = Get-ItemProperty "IIS:\Sites\$($site.Name)" $_[0]
if((-not $parameter_value) -or ($parameter_value.Value -as [String]) -ne $_[1]) {
switch ($property_value.GetType().Name)
{
"ConfigurationAttribute" { $parameter_value = $property_value.value }
"String" { $parameter_value = $property_value }
}
if((-not $parameter_value) -or ($parameter_value) -ne $_[1]) {
Set-ItemProperty "IIS:\Sites\$($site.Name)" $_[0] $_[1] Set-ItemProperty "IIS:\Sites\$($site.Name)" $_[0] $_[1]
$result.changed = $true $result.changed = $true
} }