mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user