# .SYNOPSIS Converts Markdown formatted text to HTML. .DESCRIPTION Converts Markdown formatted text to HTML using the Github API. Output is "flavored" depending on the chosen mode. The default output flavor is 'Markdown' and includes Syntax highlighting and Github stylesheets. Based on the Ruby version by Brett Terpstra: http://brettterpstra.com/easy-command-line-github-flavored-markdown/ About Markdown: http://daringfireball.net/projects/markdown/ #> function ConvertFrom-Markdown { [CmdletBinding()] Param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)] [PSObject[]]$InputObject ) Begin { $URL = "https://api.github.com/markdown" } Process { Foreach ($item in $InputObject) { $object = New-Object -TypeName psobject $object | Add-Member -MemberType NoteProperty -Name 'text' -Value ($item | Out-String) $object | Add-Member -MemberType NoteProperty -Name 'mode' -Value 'markdown' $response = Invoke-WebRequest -Method Post -Uri $url -Body ($object | ConvertTo-Json) if ($response.StatusCode -eq "200") { $HtmlOutput = @"