项目作者: ishu3101

项目描述 :
Powershell Module to convert from a PowerShell object to a Markdown table and back
高级语言: PowerShell
项目地址: git://github.com/ishu3101/PSMarkdown.git
创建时间: 2015-11-24T22:44:43Z
项目社区:https://github.com/ishu3101/PSMarkdown

开源协议:MIT License

下载


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

  1. Install-Module PSMarkdown

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

  1. 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

  1. Import-Module PSMarkdown

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

Get Help

  • List of all available commands

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

    1. 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

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

Example

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

ConvertFrom-Markdown

Converts a Markdown table to a PowerShell object.

Usage

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

Example

  1. Get-Service | Select-Object Name, DisplayName, Status | ConvertTo-Markdown | ConvertFrom-Markdown
  1. Get-Process | Unique | Select-Object Name, Path, Company | ConvertTo-Markdown | ConvertFrom-Markdown
  1. 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.