# Get-MtSafeMarkdown

Escapes text to be safe to use in markdown.

Source: https://maester.dev/docs/commands/Get-MtSafeMarkdown

## SYNOPSIS

Escapes text to be safe to use in markdown.

## SYNTAX

```powershell
Get-MtSafeMarkdown [[-Text] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## 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 '![x](https://attacker.example/pixel.png)' or '[Sign in again](https://phish.example)' 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 so are the ones that make GFM
turn text into a link on its own: a bare 'https://host', 'ftp://host', 'www.host', 'a@b' or
'mailto:a@b' is an autolink literal, not markdown syntax, and the report renders with
'gfm: true'.
Line breaks are replaced with spaces.
Every backslash added here is consumed by
the renderer, so the value is displayed exactly as entered.

## EXAMPLES

### EXAMPLE 1

```powershell
Get-MtSafeMarkdown -Text $tenantName
```

Converts the content of $tenantName into something safe to use in markdown.

### EXAMPLE 2

```powershell
"| [$(Get-MtSafeMarkdown $app.displayName)]($portalLink) |"
```

Uses a tenant-controlled app name as link text in a markdown table row.

## PARAMETERS

### -Text

The text to escape

```yaml
Type: String
Parameter Sets: (All)
Aliases:

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

### -ProgressAction

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

```yaml
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](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### System.String

## NOTES

## RELATED LINKS

[https://maester.dev/docs/commands/Get-MtSafeMarkdown](https://maester.dev/docs/commands/Get-MtSafeMarkdown)
