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 {
[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
}
}
}