1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

bugfix win_feature.ps1

This commit is contained in:
Trond Hindenes 2016-01-08 14:56:42 +01:00 committed by Matt Clay
parent 21b79123a4
commit 37a24cc1b1

View file

@ -60,26 +60,26 @@ If ($state -eq "present") {
if ($IncludeManagementTools -eq $true)
{
$InstallParams.add("IncludeManagementTools";$includemanagementtools)
$InstallParams.add("IncludeManagementTools",$includemanagementtools)
}
if ($source -ne $null)
{
$InstallParams.add("Source";$source)
$InstallParams.add("Source",$source)
}
try {
If (Get-Command "Install-WindowsFeature" -ErrorAction SilentlyContinue) {
$featureresult = Install-WindowsFeature @Params
$featureresult = Install-WindowsFeature @InstallParams
}
ElseIf (Get-Command "Add-WindowsFeature" -ErrorAction SilentlyContinue) {
if ($IncludeManagementTools)
{
$Params.Remove("IncludeManagementTools")
}
$featureresult = Add-WindowsFeature @Params
$featureresult = Add-WindowsFeature @InstallParams
}
Else {
Fail-Json $result "Not supported on this version of Windows"