Skip to content

Commit

Permalink
Removed UpgradeLowerVersion parameter and switched default functional…
Browse files Browse the repository at this point in the history
…ity to be to upgrade a package
  • Loading branch information
Adam Kreiss committed Jun 26, 2020
1 parent b81c7c4 commit dd0c3ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ function Set-TargetResource
[String]
$chocoParams,
[bool]
$AutoUpgrade = $false,
[bool]
$UpgradeLowerVersion = $false
$AutoUpgrade = $false
)
Write-Verbose -Message 'Start Set-TargetResource'
$isVersionPresent = $PSBoundParameters.ContainsKey('Version')
Expand Down Expand Up @@ -131,7 +129,7 @@ function Set-TargetResource
$canUpgrade = $installedVersion.CompareTo($targetVersion) -le 0
}

if ($UpgradeLowerVersion -and $canUpgrade) {
if ($canUpgrade) {
Write-Verbose -Message "Upgrading $Name to version $Version"
Upgrade-Package -pName $Name -pParams $Params -pVersion $Version
}
Expand Down Expand Up @@ -189,9 +187,7 @@ function Test-TargetResource
[String]
$chocoParams,
[bool]
$AutoUpgrade = $false,
[bool]
$UpgradeLowerVersion = $false
$AutoUpgrade = $false
)

Write-Verbose -Message 'Start Test-TargetResource'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ class cChocoPackageInstall : OMI_BaseResource
[write] string Source;
[Write] String chocoParams;
[Write] Boolean AutoUpgrade;
[Write] Boolean UpgradeLowerVersion;
};

0 comments on commit dd0c3ff

Please sign in to comment.