<commit_before>---
external help file: platyPS-help.xml
schema: 2.0.0
---

# Get-MarkdownMetadata
## SYNOPSIS
{{Fill the Synopsis}}

## SYNTAX

### MarkdownPath
```
Get-MarkdownMetadata -Path <String> [<CommonParameters>]
```

### MarkdownContent
```
Get-MarkdownMetadata -Markdown <String> [<CommonParameters>]
```

### MarkdownFileInfo
```
Get-MarkdownMetadata -FileInfo <FileInfo> [<CommonParameters>]
```

## DESCRIPTION
{{Fill the Description}}

## EXAMPLES

### Example 1
```
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Path
{{Fill Path Description}}

```yaml
Type: String
Parameter Sets: MarkdownPath
Aliases: 

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

### -Markdown
{{Fill Markdown Description}}

```yaml
Type: String
Parameter Sets: MarkdownContent
Aliases: 

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

### -FileInfo
```yaml
Type: FileInfo
Parameter Sets: MarkdownFileInfo
Aliases: 

Required: True
Position: Named
Default value: 
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

## NOTES

## RELATED LINKS

[Online Version:]()

<commit_msg>Update documentation in Get-MarkdownMetadata.md<commit_after>---
external help file: platyPS-help.xml
schema: 2.0.0
---

# Get-MarkdownMetadata
## SYNOPSIS
Get markdown metadata header in the form of a hashtable.

## SYNTAX

### MarkdownPath
```
Get-MarkdownMetadata -Path <String> [<CommonParameters>]
```

### MarkdownContent
```
Get-MarkdownMetadata -Markdown <String> [<CommonParameters>]
```

### MarkdownFileInfo
```
Get-MarkdownMetadata -FileInfo <FileInfo> [<CommonParameters>]
```

## DESCRIPTION
PlatyPS stores metadata information at the top of a markdown file.
It's stored as key-value string pairs.

By default, platyPS stores help file name and markdown schema version.

The metadata section can contain user-provided key-value string pairs.
They would be ignore by [New-ExternalHelp](New-ExternalHelp.md).
These values can be used by external tools.

[Get-MarkdownMetadata](Get-MarkdownMetadata.md) provides a consistent way to retrieve these key-value pairs.
They return as a key-value <Dictionary[String, String]> object.

## EXAMPLES

### Example 1 (Get metadata by Path)
```
PS C:\> Get-MarkdownMetadata -Path .\docs\Get-MarkdownMetadata.md

Key                Value
---                -----
external help file platyPS-help.xml
schema             2.0.0

```

Retrives metadata from a markdown file at the path provided.

### Example 2 (Get metadata from a markdown string)
```
PS C:\> $markdown = cat -Raw .\docs\Get-MarkdownMetadata.md 
PS C:\> Get-MarkdownMetadata -Markdown $markdown

Key                Value
---                -----
external help file platyPS-help.xml
schema             2.0.0

```

Retrives metadata from a markdown string.

### Example 3 (Get metadata from a FileInfo object)
```
PS C:\> Get-MarkdownMetadata -FileInfo (ls .\docs\Get-MarkdownMetadata.md)

Key                Value
---                -----
external help file platyPS-help.xml
schema             2.0.0

```

Retrives metadata using a FileInfo object to provide the path.

## PARAMETERS

### -Path
Path to markdown file.
Markdown files typically use extension .md

```yaml
Type: String
Parameter Sets: MarkdownPath
Aliases: 

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

### -Markdown
String object containing markdown.

```yaml
Type: String
Parameter Sets: MarkdownContent
Aliases: 

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

### -FileInfo
FileInfo that points to a markdown file.

```yaml
Type: FileInfo
Parameter Sets: MarkdownFileInfo
Aliases: 

Required: True
Position: Named
Default value: 
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
### None
You cannot pipe objects into this cmdlet.

## OUTPUTS
### Dictionary[String, String]
The dictionary contains key-value pairs found in the markdown metadata block.

## NOTES

## RELATED LINKS

[Online Version:](https://github.com/PowerShell/platyPS/blob/master/docs/Get-MarkdownMetadata.md)


{'fraction_non_alphanumeric': 0.11694032839407288, 'fraction_numerical': 0.0062074489387264715, 'mean_word_length': 4.176165803108808, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2985018', 'n_tokens_mistral': 1541, 'n_tokens_neox': 1447, 'n_words': 495}