Skip to content

Commit

Permalink
Address SQL Server 2022 issue with Test-DbaDbCompatibility (#8706)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton authored Dec 29, 2022
1 parent 5cf381b commit de71773
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ body:
label: "Verified issue does not already exist?"
description: "Please search to see if an issue already exists for the bug you encountered."
options:
- "No, I did not search"
- "I have searched and found no existing issue"
validations:
required: true
Expand Down
5 changes: 2 additions & 3 deletions bin/PSScriptAnalyzerRules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'

'PSAlignAssignmentStatement'
# 'PSUseCorrectCasing' ## We do not like the use of -EQ, prefer -eq
)
Rules = @{
PSUseCompatibleSyntax = @{
Expand Down
2 changes: 1 addition & 1 deletion functions/Test-DbaDbCompatibility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Test-DbaDbCompatibility {
Stop-Function -Message "Failure" -Category ConnectionError -ErrorRecord $_ -Target $instance -Continue
}

$serverLevel = [Microsoft.SqlServer.Management.Smo.CompatibilityLevel]"Version$($server.VersionMajor)0"
$serverLevel = [Microsoft.SqlServer.Management.Smo.CompatibilityLevel]$server.Databases['master'].CompatibilityLevel
$dbs = $server.Databases

if ($Database) {
Expand Down

0 comments on commit de71773

Please sign in to comment.