fix: 8.1.1 aligned with test-template

This commit is contained in:
DrIOS
2024-05-28 14:51:24 -05:00
parent f445893aed
commit 686272d4e0

View File

@@ -1,13 +1,16 @@
function Test-TeamsExternalFileSharing { function Test-TeamsExternalFileSharing {
[CmdletBinding()] [CmdletBinding()]
param ( param (
# Aligned
# Parameters can be added here if needed # Parameters can be added here if needed
) )
begin { 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 { process {
@@ -30,7 +33,6 @@ function Test-TeamsExternalFileSharing {
} }
# Create an instance of CISAuditResult and populate it # Create an instance of CISAuditResult and populate it
$auditResult = [CISAuditResult]::new()
$auditResult.CISControlVer = "v8" $auditResult.CISControlVer = "v8"
$auditResult.CISControl = "3.3" $auditResult.CISControl = "3.3"
$auditResult.CISDescription = "Configure Data Access Control Lists" $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.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.FailureReason = if (-not $isCompliant) { "The following non-approved providers are enabled: $($nonCompliantProviders -join ', ')" } else { "N/A" }
$auditResult.Status = if ($isCompliant) { "Pass" } else { "Fail" } $auditResult.Status = if ($isCompliant) { "Pass" } else { "Fail" }
$auditResults += $auditResult
} }
end { end {
# Return auditResults # Return auditResult
return $auditResults return $auditResult
} }
} }