Skip to content

Commit

Permalink
(chocolateyGH-85) Pass the source to cChocoPackageInstallerSet correctly
Browse files Browse the repository at this point in the history
The cChocoPackageInstallerSet resource only provides the Source
parameter to the first package being installed. This occurred due to
historical reasons where the Source would be added to the system
rather than being specified.

This commit will pass the Source in for every package.
  • Loading branch information
Jark committed Jun 22, 2017
1 parent b2cc236 commit 2ed30be
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,11 @@ Composite DSC Resource allowing you to specify multiple choco packages in a sing
$Source
)

$addSource = $Source

foreach ($pName in $Name) {
## We only need to specify the source one time,
## so we do it only with the first package
if ($addSource) {
cChocoPackageInstaller "cChocoPackageInstaller_$($Ensure)_$($pName)" {
Ensure = $Ensure
Name = $pName
Source = $Source
}
$addSource = $null
}
else {
cChocoPackageInstaller "cChocoPackageInstaller_$($Ensure)_$($pName)" {
Ensure = $Ensure
Name = $pName
}
cChocoPackageInstaller "cChocoPackageInstaller_$($Ensure)_$($pName)" {
Ensure = $Ensure
Name = $pName
Source = $Source
}
}
}

0 comments on commit 2ed30be

Please sign in to comment.