Add-MtTestResultDetail
SYNOPSIS
Add detailed information about a test so that it can be displayed in the test results report.
SYNTAX
Add-MtTestResultDetail [[-Description] <String>] [[-Result] <String>] [[-GraphObjects] <Object[]>]
[[-GraphObjectType] <String>] [[-TestName] <String>] [[-TestTitle] <String>] [[-SkippedBecause] <String>]
[[-SkippedCustomReason] <String>] [[-SkippedError] <Object>] [[-Severity] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
This function is used to add detailed information about a test so that it can be displayed in the test results report.
The description and result support markdown format.
If the calling script/cmdlet has a markdown file with the same name as the script/cmdlet, it will be used to populate the description and result fields.
A good example is the markdown for the Test-MtCaEmergencyAccessExists cmdlet:
- https://github.com/maester365/maester/blob/main/powershell/public/Test-MtCaEmergencyAccessExists.md
- https://github.com/maester365/maester/blob/main/powershell/public/Test-MtCaEmergencyAccessExists.ps1
The markdown file can include a separator <!--- Results --->
to split the description and result sections.
This allows for the overview and detailed information to be displayed separately in the Test results.
EXAMPLES
EXAMPLE 1
Add-MtTestResultDetail -Description 'Test description' -Result 'Test result'
This example adds detailed information about a test with a brief description and the result of the test.
$policiesWithoutEmergency = $policies | Where-Object { $CheckId -notin $_.conditions.users.excludeUsers -and $CheckId -notin $_.conditions.users.excludeGroups }
Add-MtTestResultDetail -GraphObjects $policiesWithoutEmergency -GraphObjectType ConditionalAccess
This example shows how to use the Add-MtTestResultDetail function to add rich markdown content to the test results with deep links to the admin portal.
PARAMETERS
-Description
Brief description of what this test is checking. Markdown is supported.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False