diff --git a/checks/Instancev5.Tests.ps1 b/checks/Instancev5.Tests.ps1 index 2aec1f7d..798e817f 100644 --- a/checks/Instancev5.Tests.ps1 +++ b/checks/Instancev5.Tests.ps1 @@ -102,4 +102,12 @@ Describe "OLE Automation" -Tag OLEAutomation, Security, CIS, Low, Instance -ForE $PSItem.Configuration.OleAutomationProceduresEnabled.ConfigValue -eq 1 | Should -Be $psitem.ConfigValues.OLEAutomation -Because 'OLE Automation can introduce additional security risks' } } -} \ No newline at end of file +} +Describe "Ad Hoc Workload Optimization" -Tag AdHocWorkload, Medium, Instance -ForEach $InstancesToTest { + $skip = Get-DbcConfigValue skip.instance.AdHocWorkload + Context "Checking Ad Hoc Workload Optimization on <_.Name>" { + It "Ad Hoc Workload Optimization is enabled on <_.Name>" -Skip:($skip -or $psitem.VersionMajor -lt 10) { + $PSItem.Configuration.OptimizeAdhocWorkloads.ConfigValue -eq 1 | Should -Be 1 -Because "Optimize for ad hoc workloads is a recommended setting" + } + } +} diff --git a/internal/functions/NewGet-AllInstanceInfo.ps1 b/internal/functions/NewGet-AllInstanceInfo.ps1 index 40c739a6..23202ac6 100644 --- a/internal/functions/NewGet-AllInstanceInfo.ps1 +++ b/internal/functions/NewGet-AllInstanceInfo.ps1 @@ -57,6 +57,9 @@ function NewGet-AllInstanceInfo { $configurations = $true $ConfigValues | Add-Member -MemberType NoteProperty -Name 'OLEAutomation' -Value (Get-DbcConfigValue policy.oleautomation) } + 'AdHocWorkload' { + $configurations = $true + } Default { } }