Skip to main content
Version: 2.0.1 (preview)

Send-MtMail

SYNOPSISโ€‹

Send an email with the summary of the Maester test results

SYNTAXโ€‹

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

DESCRIPTIONโ€‹

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.

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Send-MtMail -MaesterResults $MaesterResults -Recipient john@contoso.com, sam@contoso.com -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.

PARAMETERSโ€‹

-MaesterResultsโ€‹

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

-Recipientโ€‹

The email addresses of the recipients. e.g. john@contoso.com

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Subjectโ€‹

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

-TestResultsUriโ€‹

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

-CreateBodyOnlyโ€‹

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

-UserIdโ€‹

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

-ProgressActionโ€‹

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

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

INPUTSโ€‹

OUTPUTSโ€‹

System.Collections.Hashtableโ€‹

NOTESโ€‹

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