diff --git a/lib/ansible/modules/windows/win_feature.ps1 b/lib/ansible/modules/windows/win_feature.ps1 index 62960d581e3..339b79b9d7b 100644 --- a/lib/ansible/modules/windows/win_feature.ps1 +++ b/lib/ansible/modules/windows/win_feature.ps1 @@ -63,7 +63,7 @@ If ($state -eq "present") { $InstallParams.add("IncludeManagementTools",$includemanagementtools) } - if ($source -ne $null) + if ($source) { $InstallParams.add("Source",$source) } @@ -77,7 +77,7 @@ If ($state -eq "present") { ElseIf (Get-Command "Add-WindowsFeature" -ErrorAction SilentlyContinue) { if ($IncludeManagementTools) { - $Params.Remove("IncludeManagementTools") + $InstallParams.Remove("IncludeManagementTools") } $featureresult = Add-WindowsFeature @InstallParams }