diff --git a/source/tests/Test-TeamsExternalFileSharing.ps1 b/source/tests/Test-TeamsExternalFileSharing.ps1 index 0c7d5ba..9226a64 100644 --- a/source/tests/Test-TeamsExternalFileSharing.ps1 +++ b/source/tests/Test-TeamsExternalFileSharing.ps1 @@ -1,13 +1,16 @@ function Test-TeamsExternalFileSharing { [CmdletBinding()] param ( + # Aligned # Parameters can be added here if needed ) begin { - # Dot source the class script + # Dot source the class script if necessary + #. .\source\Classes\CISAuditResult.ps1 + # Initialization code, if needed - $auditResults = @() + $auditResult = [CISAuditResult]::new() } process { @@ -30,7 +33,6 @@ function Test-TeamsExternalFileSharing { } # Create an instance of CISAuditResult and populate it - $auditResult = [CISAuditResult]::new() $auditResult.CISControlVer = "v8" $auditResult.CISControl = "3.3" $auditResult.CISDescription = "Configure Data Access Control Lists" @@ -45,12 +47,10 @@ function Test-TeamsExternalFileSharing { $auditResult.Details = if (-not $isCompliant) { "Non-approved providers enabled: $($nonCompliantProviders -join ', ')" } else { "All cloud storage services are approved providers" } $auditResult.FailureReason = if (-not $isCompliant) { "The following non-approved providers are enabled: $($nonCompliantProviders -join ', ')" } else { "N/A" } $auditResult.Status = if ($isCompliant) { "Pass" } else { "Fail" } - - $auditResults += $auditResult } end { - # Return auditResults - return $auditResults + # Return auditResult + return $auditResult } -} \ No newline at end of file +}