Skip to content

Powershell Module to convert from a PowerShell object to a Markdown table and back

License

Notifications You must be signed in to change notification settings

ishu3101/PSMarkdown

Repository files navigation

PSMarkdown

A Powershell Module that lets you convert from a PowerShell object to a Markdown table and back.

Table of Contents

Install

There are two ways to install this module. If you are running PowerShell v5

Install-Module PSMarkdown

Otherwise, to install in your personal modules folder (e.g. ~\Documents\WindowsPowerShell\Modules), run:

iex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/ishu3101/PSMarkdown/master/Install.ps1')

Getting Started

To start using, just import the module using

Import-Module PSMarkdown

After installation, the following commands are available: ConvertTo-Markdown, ConvertFrom-Markdown

Get Help

  • List of all available commands

    Get-Command -Module PSMarkdown
  • Help for a specific command.

    Get-Help <command>

Commands

For more detailed information about a command use the help

ConvertTo-Markdown

Converts a PowerShell object to a Markdown table.

Usage

ConvertTo-Markdown [-InputObject] <PSObject[]> [<CommonParameters>]

Example

Get-Process | Where-Object {$_.mainWindowTitle} | Select-Object ID, Name, Path, Company | ConvertTo-Markdown
ConvertTo-Markdown (Get-Date)
Get-Alias | Select-Object Name, DisplayName | ConvertTo-Markdown

ConvertFrom-Markdown

Converts a Markdown table to a PowerShell object.

Usage

ConvertFrom-Markdown [-InputObject] <Object> [<CommonParameters>]

Example

Get-Service | Select-Object Name, DisplayName, Status | ConvertTo-Markdown | ConvertFrom-Markdown
Get-Process | Unique | Select-Object Name, Path, Company | ConvertTo-Markdown | ConvertFrom-Markdown
ConvertTo-Markdown (Get-Service | Where-Object {$_.Status -eq "Running"} | Select-Object Name, DisplayName, Status) | ConvertFrom-Markdown

Credit

Thanks Ben Neise for the initial code for ConvertTo-Markdown function

License

PSMarkdown is released under the MIT license. See LICENSE for details.

About

Powershell Module to convert from a PowerShell object to a Markdown table and back

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published