From 7f59f7d80e94249aee53e1eafc5644300b70ed90 Mon Sep 17 00:00:00 2001 From: jn-bedag <34773157+jn-bedag@users.noreply.github.com> Date: Mon, 8 Jan 2018 01:26:16 +0100 Subject: [PATCH] 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 df75d3bb0d152b10c24187ce4c643b4733bae336. --- lib/ansible/modules/windows/win_iis_website.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/win_iis_website.ps1 b/lib/ansible/modules/windows/win_iis_website.ps1 index 8a5a252e10..731ffca95b 100644 --- a/lib/ansible/modules/windows/win_iis_website.ps1 +++ b/lib/ansible/modules/windows/win_iis_website.ps1 @@ -150,8 +150,15 @@ Try { # Set properties if($parameters) { $parameters | foreach { - $parameter_value = Get-ItemProperty "IIS:\Sites\$($site.Name)" $_[0] - if((-not $parameter_value) -or ($parameter_value.Value -as [String]) -ne $_[1]) { + $property_value = Get-ItemProperty "IIS:\Sites\$($site.Name)" $_[0] + + 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] $result.changed = $true }