You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoke-Catch-Message "Failed to connect to $SqlInstance`: $message"
235
235
}
236
236
}
237
237
catch {
@@ -257,14 +257,23 @@ PROCESS {
257
257
258
258
Write-Verbose"Checking the Compatibility Level of Database $Database on $SqlInstance"
259
259
# We only support between SQL Server 2008 (version100) and SQL Server 2014 (version120)
260
-
$CompLevel=$instance.databases|where-Object Name -eq$Database|select CompatibilityLevel
260
+
$CompLevel=$instance.databases|Where-Object Name -eq$Database|Select-Object CompatibilityLevel
261
261
if ($CompLevel.CompatibilityLevel-replace"Version"-lt100-or$CompLevel.CompatibilityLevel-replace"Version"-gt120 ) {
262
-
Invoke-Catch-Message "OQS is only supported between SQL Server 2008 (version100) to SQL Server 2014 (version120). Your database compatibility level is $($CompLevel.CompatibilityLevel). Installation cancelled."
262
+
Invoke-Catch-Message "OQS is only supported between SQL Server 2008 (version100) to SQL Server 2014 (version120). Your database compatibility level is $($CompLevel.CompatibilityLevel). Installation cancelled."
263
263
}
264
264
Write-Verbose"Database compatibility Check passed - Compatibility is $($CompLevel.CompatibilityLevel)"
265
265
266
266
# If we are installing Service Broker for scheduling, we need to do housekeeping for the certificate
267
267
if ($InstallationType-eq"Service Broker") {
268
+
269
+
Write-Verbose"Checking if Database $Database has Service Broker activated on $SqlInstance"
270
+
if ($pscmdlet.ShouldProcess("$SqlInstance","Checking if service broker is enabled in $database")) {
271
+
if (-not ($instance.Databases|Where-Object Name -eq$Database) -and ($BrokerEnabled-eq$True)) {
272
+
Invoke-Catch-Message "Service Broker is not enabled in [$Database] on instance $SqlInstance. This is a blocking operation, please enable service broker and re-run this installer."
273
+
}
274
+
}
275
+
Write-Verbose"Service Broker is enabled in $Database on $SqlInstance"
0 commit comments