The ConvertTo-Markdown PowerShell function is designed to help automate the conversion of arrays, hashtables, and PSCustomObjects into Markdown format. This tool is particularly useful for generating documentation, reports, or any content where structured data needs to be presented in a readable Markdown format.
- Array to List Conversion: Converts an array of elements into a Markdown formatted list.
- Hashtable and PSCustomObject to Table Conversion: Converts hashtables and PSCustomObjects into Markdown tables, making structured data readable and easy to understand.
- PowerShell 5.1 or higher
This function does not require installation. You can simply copy the ConvertTo-Markdown function code into your PowerShell script or session.
$array = 1..5
$array | ConvertTo-MarkdownOutput:
- 1
- 2
- 3
- 4
- 5
$hashtable = @{Name='John Doe'; Age=30; Department='IT'}
$hashtable | ConvertTo-MarkdownOutput:
| Name | Age | Department |
|----------|-----|------------|
| John Doe | 30 | IT |
$object = [PSCustomObject]@{Name='Jane Doe'; Age=29; Department='HR'}
$object | ConvertTo-MarkdownOutput:
| Name | Age | Department |
|----------|-----|------------|
| Jane Doe | 29 | HR |
Contributions to improve ConvertTo-Markdown are welcome. Please feel free to fork the repository, make changes, and submit pull requests.
GNU General Public License v3.0