fixed $source null check, reference to $Params

$source check causes:
FAILED! => {"changed": false, "failed": true, "msg": "A parameter cannot be found that matches parameter name 'Source'."}

$Params.Remove causes:
FAILED! => {"changed": false, "failed": true, "msg": "Method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'Remove'."}
pull/18777/head
Daniel Petty 9 years ago committed by Matt Clay
parent a522c2d99f
commit 6441556b98

@ -63,7 +63,7 @@ If ($state -eq "present") {
$InstallParams.add("IncludeManagementTools",$includemanagementtools) $InstallParams.add("IncludeManagementTools",$includemanagementtools)
} }
if ($source -ne $null) if ($source)
{ {
$InstallParams.add("Source",$source) $InstallParams.add("Source",$source)
} }
@ -77,7 +77,7 @@ If ($state -eq "present") {
ElseIf (Get-Command "Add-WindowsFeature" -ErrorAction SilentlyContinue) { ElseIf (Get-Command "Add-WindowsFeature" -ErrorAction SilentlyContinue) {
if ($IncludeManagementTools) if ($IncludeManagementTools)
{ {
$Params.Remove("IncludeManagementTools") $InstallParams.Remove("IncludeManagementTools")
} }
$featureresult = Add-WindowsFeature @InstallParams $featureresult = Add-WindowsFeature @InstallParams
} }

Loading…
Cancel
Save