Skip to content

Commit dfea078

Browse files
TwoYearDigit Cutoff added and tested #822
1 parent 6c72699 commit dfea078

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

Perf Testing pesterv5.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ipmo ./dbachecks.psd1
1414

1515
#
1616

17-
$Checks = 'MaxDopInstance','ErrorLogCount','ModelDbGrowth','DefaultBackupCompression','SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
18-
$Checks = 'MaxDopInstance'
17+
$Checks = 'TwoDigitYearCutoff','MaxDopInstance','ErrorLogCount','ModelDbGrowth','DefaultBackupCompression','SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
18+
$Checks = 'TwoDigitYearCutoff'
1919
Compare-CheckRuns -Checks $checks
2020

2121
<#

Validate v4 adn v5.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ipmo ./dbachecks.psd1
1414

1515
#
1616

17-
$Checks = 'MaxDopInstance','ErrorLogCount','ModelDbGrowth','DefaultBackupCompression','SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
18-
$Checks = 'MaxDopInstance'
17+
$Checks = 'TwoDigitYearCutoff','MaxDopInstance','ErrorLogCount','ModelDbGrowth','DefaultBackupCompression','SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
18+
$Checks = 'TwoDigitYearCutoff'
1919
Compare-v4andv5Results -Checks $Checks
2020

2121
<#

checks/Instancev5.Tests.ps1

+9
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,12 @@ Describe "Instance MaxDop" -Tag MaxDopInstance, MaxDop, Medium, Instance -ForEac
208208
}
209209
}
210210
}
211+
212+
Describe "Two Digit Year Cutoff" -Tag TwoDigitYearCutoff, Low, Instance -ForEach $InstancesToTest {
213+
$skip = Get-DbcConfigValue skip.instance.TwoDigitYearCutoff
214+
Context "Testing Two Digit Year Cutoff on <_.Name>" {
215+
It "Two Digit Year Cutoff is set to <_.ConfigValues.TwoDigitYearCutoff> on <_.Name>" -Skip:$skip {
216+
$PSItem.Configuration.TwoDigitYearCutoff.ConfigValue | Should -Be $psitem.ConfigValues.TwoDigitYearCutoff -Because 'This is the value that you have chosen for Two Digit Year Cutoff configuration'
217+
}
218+
}
219+
}

internal/functions/NewGet-AllInstanceInfo.ps1

+5
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ function NewGet-AllInstanceInfo {
142142
$MaxDopSettings = (Test-DbaMaxDop -SqlInstance $Instance)[0] # because we dont care about the database maxdops here - potentially we could store it and use it for DatabaseMaxDop ?
143143
}
144144
}
145+
'TwoDigitYearCutoff' {
146+
$configurations = $true
147+
$ConfigValues | Add-Member -MemberType NoteProperty -Name 'TwoDigitYearCutoff' -Value (Get-DbcConfigValue policy.twodigityearcutoff)
148+
149+
}
145150

146151
Default { }
147152
}

0 commit comments

Comments
 (0)