Send-MtMail
SYNOPSIS
Section titled “SYNOPSIS”Send an email with the summary of the Maester test results
SYNTAX
Section titled “SYNTAX”Send-MtMail [-MaesterResults] <PSObject> [-Recipient] <String[]> [-Subject <String>] [-TestResultsUri <String>] [-CreateBodyOnly] [-UserId <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]DESCRIPTION
Section titled “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 -SendMailWhen 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
Section titled “EXAMPLES”EXAMPLE 1
Section titled “EXAMPLE 1”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.
PARAMETERS
Section titled “PARAMETERS”-MaesterResults
Section titled “-MaesterResults”The Maester test results returned from Invoke-Pester -PassThru | ConvertTo-MtMaesterResult
Type: PSObjectParameter Sets: (All)Aliases:
Required: TruePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Recipient
Section titled “-Recipient”The email addresses of the recipients. e.g. [email protected]
Type: String[]Parameter Sets: (All)Aliases:
Required: TruePosition: 2Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Subject
Section titled “-Subject”The subject of the email. Defaults to ‘Maester Test Results’.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-TestResultsUri
Section titled “-TestResultsUri”Absolute HTTP or HTTPS URI to the detailed test results page.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-CreateBodyOnly
Section titled “-CreateBodyOnly”Does not send the email, but outputs the body to use elsewhere
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False-UserId
Section titled “-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: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “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.