In the last post Check out this Two for One PowerShell code I showed the PowerShell script that transforms a simple markdown file, with a couple additions, into book chapters and how it also uses the PowerShell ScriptAnalyzer to check the code samples in your markdown for correctness.

Convert From Markdown: In Action Video

Check it out, How to ConvertFrom-Markdown with all the bells and whistles.

Create a PDF

There’s another cool feature in the module. If you have both Pandoc and the LaTEX library MiKTeX installed, you can use the -OutputType PDF switch to generate a PDF, table of contents included, like this.

ConvertFrom-Markdown -OutputType PDF

Markdown To PDF

Running ConvertFrom-Markdown -OutputType PDF, converts the markdown contents to separate chapter files, runs PowerShell ScriptAnalyzer on your samples, and then looks to see if the Pandoc tool is installed. If so, it runs it against the chapter files, creating the PDF complete with a table of contents.

Note: ConvertFrom-Markdown also supports creating HTML and Microsoft Word docs

ConvertFrom-Markdown -OutputType Docx
ConvertFrom-Markdown -OutputType Html

Installing Pandoc On Windows

So, grab the module on the PowerShell Gallery and if you want to auto create the PDF install these great tools.