fix: 2.1.4 output
This commit is contained in:
@@ -4,10 +4,6 @@ function Test-SafeAttachmentsPolicy {
|
|||||||
param ()
|
param ()
|
||||||
|
|
||||||
begin {
|
begin {
|
||||||
# Dot source the class script if necessary
|
|
||||||
#. .\source\Classes\CISAuditResult.ps1
|
|
||||||
|
|
||||||
# Initialization code, if needed
|
|
||||||
$recnum = "2.1.4"
|
$recnum = "2.1.4"
|
||||||
|
|
||||||
<#
|
<#
|
||||||
@@ -71,8 +67,10 @@ function Test-SafeAttachmentsPolicy {
|
|||||||
# The result is a pass if there are no failure reasons
|
# The result is a pass if there are no failure reasons
|
||||||
$result = $failureReasons.Count -eq 0
|
$result = $failureReasons.Count -eq 0
|
||||||
|
|
||||||
# Format details for output
|
# Format details for output manually
|
||||||
$detailsString = $details | Format-Table -AutoSize | Out-String
|
$detailsString = "Policy|Enabled|Action|Failed`n" + ($details |
|
||||||
|
ForEach-Object {"$($_.Policy)|$($_.Enabled)|$($_.Action)|$($_.Failed)`n"}
|
||||||
|
)
|
||||||
$failureReasonsString = ($failureReasons | ForEach-Object { $_ }) -join ' '
|
$failureReasonsString = ($failureReasons | ForEach-Object { $_ }) -join ' '
|
||||||
|
|
||||||
# Create and populate the CISAuditResult object
|
# Create and populate the CISAuditResult object
|
||||||
@@ -103,8 +101,8 @@ function Test-SafeAttachmentsPolicy {
|
|||||||
Rec = $recnum
|
Rec = $recnum
|
||||||
Result = $false
|
Result = $false
|
||||||
Status = "Fail"
|
Status = "Fail"
|
||||||
Details = "No M365 E5 licenses found."
|
Details = "No Safe Attachments policies found."
|
||||||
FailureReason = "The audit is for M365 E5 licenses and the required EXO commands will not be available otherwise."
|
FailureReason = "The audit needs Safe Attachment features available or required EXO commands will not be available otherwise."
|
||||||
}
|
}
|
||||||
$auditResult = Initialize-CISAuditResult @params
|
$auditResult = Initialize-CISAuditResult @params
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user