Skip to content

Commit 9721460

Browse files
committed
(#291) Allow for Beta Testing CCM Packages
The installer should allow for testing beta packages where available, as long as we've specified the version. This should control that more precisely.
1 parent 817b30c commit 9721460

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Start-C4bCcmSetup.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ process {
135135

136136
Write-Host "Creating Chocolatey Central Management Database"
137137
$chocoArgs = @('install', 'chocolatey-management-database', '--source="ChocolateyInternal"', '-y', '--package-parameters="''/ConnectionString=Server=Localhost\SQLEXPRESS;Database=ChocolateyManagement;Trusted_Connection=true;''"', '--no-progress')
138+
if ($PackageVersion = $Packages.Where{ $_.Name -eq 'chocolatey-management-database' }.Version) {
139+
$chocoArgs += "--version='$($PackageVersion)'"
140+
}
138141
& Invoke-Choco @chocoArgs
139142

140143
# Add Local Windows User:
@@ -153,6 +156,9 @@ process {
153156

154157
Write-Host "Installing Chocolatey Central Management Service"
155158
$chocoArgs = @('install', 'chocolatey-management-service', "--source='ChocolateyInternal'", '-y', "--package-parameters-sensitive=`"/ConnectionString:'Server=Localhost\SQLEXPRESS;Database=ChocolateyManagement;User ID=$DatabaseUser;Password=$DatabaseUserPw;'`"", '--no-progress')
159+
if ($PackageVersion = $Packages.Where{ $_.Name -eq 'chocolatey-management-service' }.Version) {
160+
$chocoArgs += "--version='$($PackageVersion)'"
161+
}
156162
if ($Thumbprint) {
157163
Write-Verbose "Validating certificate is in LocalMachine\TrustedPeople Store"
158164
if (-not (Get-Item Cert:\LocalMachine\TrustedPeople\$Thumbprint -EA 0) -and -not (Get-Item Cert:\LocalMachine\My\$Thumbprint -EA 0)) {
@@ -169,10 +175,13 @@ process {
169175
}
170176
& Invoke-Choco @chocoArgs
171177

172-
if (-not $MyCertificate) {$MyCertificate = Get-Item Cert:\LocalMachine\My\*}
178+
if (-not $MyCertificate) { $MyCertificate = Get-Item Cert:\LocalMachine\My\* }
173179

174180
Write-Host "Installing Chocolatey Central Management Website"
175181
$chocoArgs = @('install', 'chocolatey-management-web', "--source='ChocolateyInternal'", '-y', "--package-parameters-sensitive=""'/ConnectionString:Server=Localhost\SQLEXPRESS;Database=ChocolateyManagement;User ID=$DatabaseUser;Password=$DatabaseUserPw;'""", '--no-progress')
182+
if ($PackageVersion = $Packages.Where{ $_.Name -eq 'chocolatey-management-web' }.Version) {
183+
$chocoArgs += "--version='$($PackageVersion)'"
184+
}
176185
& Invoke-Choco @chocoArgs
177186

178187
# Setup Website SSL

0 commit comments

Comments
 (0)