Get-MtSafeMarkdown
SYNOPSIS
Section titled “SYNOPSIS”Escapes text to be safe to use in markdown.
SYNTAX
Section titled “SYNTAX”Get-MtSafeMarkdown [[-Text] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]DESCRIPTION
Section titled “DESCRIPTION”Escapes text to be safe to use in markdown.
Use this for any value that comes from the tenant (display names, app names, policy names, etc.)
before inserting it into test result markdown.
Without it, a value such as an app registration
named '
' or ‘Sign in again’ would be
rendered by the report as a remote image or a clickable link, and a ’|’ would break table layout.
Characters with meaning in markdown are backslash-escaped and line breaks are replaced with spaces, so the value is displayed exactly as entered.
EXAMPLES
Section titled “EXAMPLES”EXAMPLE 1
Section titled “EXAMPLE 1”Get-MtSafeMarkdown -Text $tenantNameConverts the content of $tenantName into something safe to use in markdown.
EXAMPLE 2
Section titled “EXAMPLE 2”"| [$(Get-MtSafeMarkdown $app.displayName)]($portalLink) |"Uses a tenant-controlled app name as link text in a markdown table row.
PARAMETERS
Section titled “PARAMETERS”The text to escape
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 1Default 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.