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'."}
This commit is contained in:
parent
a522c2d99f
commit
6441556b98
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue