Skip to content
3.0 preview2.3.0 stable

These docs describe the preview. Pick the version you run and every page marks what it doesn't have yet. Get the preview →
Maester 2.x docs (archived) →

Sponsor

Send-MtMail

Send an email with the summary of the Maester test results

Send-MtMail [-MaesterResults] <PSObject> [-Recipient] <String[]> [-Subject <String>] [-TestResultsUri <String>]
[-CreateBodyOnly] [-UserId <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Uses Graph API to send an email with the summary of the Maester test results.

This command requires the Mail.Send permission in the Microsoft Graph API.

When running interactively this can be done by running the following command:

Connect-MtGraph -SendMail

When running in a non-interactive environment (Azure DevOps, GitHub) the app needs permission to send from a mailbox, see https://maester.dev/docs/monitoring/email/ for instructions.

Send-MtMail -MaesterResults $MaesterResults -Recipient [email protected], [email protected] -Subject 'Maester Results' -TestResultsUri "https://github.com/contoso/maester/runs/123456789"

Sends an email with the summary of the Maester test results to two users along with the link to the detailed test results.

The Maester test results returned from Invoke-Pester -PassThru | ConvertTo-MtMaesterResult

Type: PSObject
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The email addresses of the recipients. e.g. [email protected]

Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The subject of the email. Defaults to ‘Maester Test Results’.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Absolute HTTP or HTTPS URI to the detailed test results page.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Does not send the email, but outputs the body to use elsewhere

Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

The user id of the sender of the mail. Defaults to the current user. This is required when using application permissions. Accepts either a GUID or UPN (User Principal Name) format.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

https://maester.dev/docs/commands/Send-MtMail