fix: Refactor Initialize-CISAuditResult to use global test definitions
This commit is contained in:
@@ -17,8 +17,7 @@ function Initialize-CISAuditResult {
|
||||
)
|
||||
|
||||
# Import the test definitions CSV file
|
||||
$testDefinitionsPath = Join-Path -Path $PSScriptRoot -ChildPath "helper/TestDefinitions.csv"
|
||||
$testDefinitions = Import-Csv -Path $testDefinitionsPath
|
||||
$testDefinitions = $script:TestDefinitionsObject
|
||||
|
||||
# Find the row that matches the provided recommendation (Rec)
|
||||
$testDefinition = $testDefinitions | Where-Object { $_.Rec -eq $Rec }
|
||||
|
@@ -161,7 +161,8 @@ function Invoke-M365SecurityAudit {
|
||||
# Load test definitions from CSV
|
||||
$testDefinitionsPath = Join-Path -Path $PSScriptRoot -ChildPath "helper\TestDefinitions.csv"
|
||||
$testDefinitions = Import-Csv -Path $testDefinitionsPath
|
||||
|
||||
# Load the Test Definitions into the script scope for use in other functions
|
||||
$script:TestDefinitionsObject = $testDefinitions
|
||||
# Apply filters based on parameter sets
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
'ELevelFilter' {
|
||||
|
Reference in New Issue
Block a user