• Stars
    star
    729
  • Rank 59,838 (Top 2 %)
  • Language
    C#
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Write PowerShell External Help in Markdown

Build status Build status

Join the chat at https://gitter.im/PowerShell/platyPS

PlatyPS

PlatyPS provides a way to:

  • Write PowerShell External Help in Markdown
  • Generate markdown help (example) for your existing modules
  • Keep markdown help up-to-date with your code

Markdown help docs can be generated from old external help files (also known as MAML-xml help), the command objects (reflection), or both.

PlatyPS can also generate cab files for Update-Help.

Why?

Traditionally PowerShell external help files have been authored by hand or using complex tool chains and rendered as MAML XML for use as console help. MAML is cumbersome to edit by hand, and common tools and editors don't support it for complex scenarios like they do with Markdown. PlatyPS is provided as a solution for allow documenting PowerShell help in any editor or tool that supports Markdown.

An additional challenge PlatyPS tackles, is to handle PowerShell documentation for complex scenarios (e.g. very large, closed source, and/or C#/binary modules) where it may be desirable to have documentation abstracted away from the codebase. PlatyPS does not need source access to generate documentation.

Markdown is designed to be human-readable, without rendering. This makes writing and editing easy and efficient. Many editors support it (Visual Studio Code, Sublime Text, etc), and many tools and collaboration platforms (GitHub, Visual Studio Online) render the Markdown nicely.

Common setups

There are 2 common setups that are used:

  1. Use markdown as the source of truth and remove other types of help.
  2. Keep comment based help as the source of truth and periodically generate markdown for web-site publishing.

They both have advantages and use-cases, you should decide what's right for you. There is slight preference toward number 1 (markdown as the source).

Quick start

Install-Module -Name platyPS -Scope CurrentUser
Import-Module platyPS
  • Create initial Markdown help for MyAwesomeModule module:
# you should have module imported in the session
Import-Module MyAwesomeModule
New-MarkdownHelp -Module MyAwesomeModule -OutputFolder .\docs
  • Edit markdown files in .\docs folder and populate {{ ... }} placeholders with missed help content.

  • Create external help from markdown help

New-ExternalHelp .\docs -OutputPath en-US\
  • Congratulations, your help is now in markdown!

  • Now, if your module code changes, you can easily update your markdown help with

# re-import your module with latest changes
Import-Module MyAwesomeModule -Force
Update-MarkdownHelp .\docs

PlatyPS markdown schema

Unfortunately, you cannot just write any Markdown, as platyPS expects Markdown to be authored in a particular way. We have defined a schema to determine how parameters are described, where scripts examples are shown, and so on.

The schema closely resembles the existing output format of the Get-Help cmdlet in PowerShell.

If you break the schema in your markdown, you will get error messages from New-ExternalHelp and Update-MarkdownHelp. You would not be able to generate extrenal help or update your markdown.

It may be fine for some scenarios, i.e. you want to have online-only version of markdown.

Supported scenarios:

  • Create Markdown

    • Using existing external help files (MAML schema, XML).
    • Using reflection
    • Using reflection and existing internal external help files.
    • For a single cmdlet
    • For an entire module
  • Update existing Markdown through reflection.

  • Create a module page .md with summary. It will also allow you to create updatable help cab.

  • Retrieve markdown metadata from markdown file.

  • Create external help xml files (MAML) from platyPS Markdown.

  • Create external help file cab

  • Preview help from generated maml file.

Remoting

PlatyPS supports working with Import-PSSession aka implicit remoting. Just pass -Session $Session parameter to the platyPS cmdlets and it will do the rest.

Build

For information about building from sources and contributing see contributing guidelines.

More Repositories

1

PowerShell

PowerShell for every system!
C#
43,120
star
2

Win32-OpenSSH

Win32 port of OpenSSH
7,063
star
3

PSReadLine

A bash inspired readline implementation for PowerShell
C#
3,494
star
4

PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
C#
1,764
star
5

vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
TypeScript
1,647
star
6

DscResources

Central repository for PowerShell Desired State Configuration (DSC) resources.
772
star
7

ConsoleGuiTools

Modules that mix PowerShell and GUIs/CUIs! - built on Avalonia and gui.cs
C#
708
star
8

PowerShellEditorServices

A common platform for PowerShell development support in any editor or application!
C#
593
star
9

Polaris

A cross-platform, minimalist web framework for PowerShell
PowerShell
506
star
10

PSResourceGet

PSResourceGet is the package manager for PowerShell
C#
453
star
11

PowerShellGetv2

PowerShellGet is the Package Manager for PowerShell
PowerShell
426
star
12

PowerShell-RFC

RFC (Request for Comments) documents for community feedback on design changes and improvements to PowerShell ecosystem
PowerShell
418
star
13

Crescendo

a module for wrapping native applications in a PowerShell function and module
PowerShell
378
star
14

PowerShell-Docker

Repository for building PowerShell Docker images
Dockerfile
377
star
15

SecretManagement

PowerShell module to consistent usage of secrets through different extension vaults
C#
302
star
16

JEA

Just Enough Administration
PowerShell
253
star
17

Operation-Validation-Framework

PowerShell
223
star
18

PowerShellGallery

PowerShell
210
star
19

SHiPS

Simple Hierarchy in PowerShell - developing PowerShell provider got so much easier
C#
184
star
20

PSSwagger

The cmdlet generator from OpenAPI (f.k.a Swagger) specification
PowerShell
163
star
21

PowerShellStandard

C#
158
star
22

SecretStore

C#
147
star
23

PSPrivateGallery

DSC Resources and Configurations to deploy and manage Private PowerShell Gallery
PowerShell
147
star
24

WindowsCompatibility

Module that allows Windows PowerShell Modules to be used from PSCore6
PowerShell
135
star
25

PowerShell-IoT

Interact with I2C, SPI & GPIO devices using PowerShell Core!
C#
129
star
26

PowerShell-Tests

Pester based tests for testing PowerShell
PowerShell
128
star
27

GPRegistryPolicyParser

PowerShell
128
star
28

PSDscResources

PowerShell
128
star
29

EditorSyntax

Syntax highlighting files for editors (VSCode, Atom, SublimeText, TextMate, etc) and GitHub!
PowerShell
122
star
30

CompletionPredictor

C#
118
star
31

Modules

C#
112
star
32

Phosphor

A library and PowerShell module for generating user interfaces from PowerShell modules
TypeScript
109
star
33

GPRegistryPolicy

PowerShell
99
star
34

psl-omi-provider

PSRP Linux support library
C
99
star
35

DSC

This repo is for the DSC v3 project
Rust
96
star
36

Microsoft.PowerShell.Archive

Archive PowerShell module contains cmdlets for working with ZIP archives
C#
92
star
37

Community-Blog

Submissions for posts to the PowerShell Community Blog -https://devblogs.microsoft.com/powershell-community
90
star
38

PSArm

PSArm is a PowerShell module that provides a PowerShell-embedded domain-specific language (DSL) for Azure Resource Manager (ARM) templates
C#
77
star
39

Remotely

Enable remote execution of scripts. Works with Pester.
PowerShell
75
star
40

TextUtility

Microsoft.PowerShell.TextUtility module
C#
58
star
41

Demo_CI

PowerShell
56
star
42

DscResource.Tests

Common meta tests for PowerShell DSC resources repositories.
PowerShell
51
star
43

PSDesiredStateConfiguration

Source for https://www.powershellgallery.com/packages/PSDesiredStateConfiguration module
PowerShell
49
star
44

Whitepapers

Staging area for new documents and whitepapers
46
star
45

PowerShell-Native

C++
44
star
46

AzurePSDrive

Navigate Azure Resources Just like A FileSystem
PowerShell
41
star
47

ContainerProvider

ContainerImageProvider
PowerShell
38
star
48

PackageManagementProviderResource

Modules with DSC resources for the PackageManagement(aka OneGet) providers.
PowerShell
37
star
49

PrivateCloud.DiagnosticInfo

PowerShell
37
star
50

Pager

Project for console pager, which is published as a NuGet package Microsoft.PowerShell.Pager
C#
34
star
51

PowerShellGet

This module provide functions used with PowerShellGet v3 to provide compatibility with scripts expecting PowerShellGet v2
PowerShell
33
star
52

PlasterBuild

Provides common build tasks for PowerShell module projects
PowerShell
29
star
53

CimPSDrive

SHiPS based provider to navigate CIM classes and namespaces
PowerShell
27
star
54

DscConfigurations

PowerShell
27
star
55

MarkdownRender

C#
27
star
56

SelfSignedCertificate

A module for generating self-signed certificates in PowerShell Core
PowerShell
25
star
57

GitHub-Actions

PowerShell
25
star
58

MMI

C#
25
star
59

tree-sitter-PowerShell

JavaScript
24
star
60

PowerShell-Snap

PowerShell
24
star
61

Microsoft.PowerShell.Kubectl

PowerShell module to manage Kubernetes
PowerShell
23
star
62

ODataUtils

PowerShell Module to generate cmdlets from an OData endpoint
PowerShell
22
star
63

DSC-Samples

Samples and tutorials for DSC v3
Go
21
star
64

WmiNamespaceSecurityDsc

This module contains DSC resources to manage WMI Namespace Security.
PowerShell
21
star
65

ThreadJob

PowerShell
21
star
66

FileUtility

C#
21
star
67

UnixCompleters

C#
18
star
68

underhanded-powershell

Underhanded PowerShell Contest Repository
PowerShell
18
star
69

LibreSSL

C
17
star
70

Hardware-Management-Module

PowerShell
17
star
71

Homebrew-Tap

Ruby
16
star
72

generator-powershell

Create PowerShell modules and scripts using Yeoman!
JavaScript
16
star
73

JsonAdapter

C#
13
star
74

Announcements

PowerShell Team Announcements
12
star
75

PowerShellModuleCoverage

Track issues related to using Windows PowerShell modules with PowerShell
12
star
76

PSRelease

PowerShell
11
star
77

whatsnew

PowerShell
11
star
78

AwsDscToolkit

AWS DSC Toolkit
PowerShell
10
star
79

DscResource.Template

PowerShell
10
star
80

TemplateConfig

Provides template for organizing DSC configuration scripts and supporting modules
PowerShell
10
star
81

SmartPackageProvider

A PackageManagement provider to find and install packages using search engines
C#
9
star
82

SystemLocaleDsc

DSC Resource for configuring Windows System Locale
PowerShell
8
star
83

xDisk

PowerShell
8
star
84

psl-pester

Fork of Pester for compatibility with PowerShell on Linux.
PowerShell
8
star
85

PowerShell-Blog-Samples

Samples for the PowerShell blog
PowerShell
7
star
86

ZLib

C
7
star
87

AWSBootStrapper

PowerShell
6
star
88

WSAProvider

A PackageManagement provider to find and install packages for Appx based packaging format
PowerShell
6
star
89

command-not-found

C#
6
star
90

PowerShellGetDsc

DSCResources for the PowerShellGet module
PowerShell
5
star
91

DscConfiguration.Tests

Test automation scripts for evaluating the quality of DSC Configurations using Azure virtual machines and Azure Automation DSC.
PowerShell
5
star
92

SILDeploymentHelper

PowerShell
4
star
93

vscode-powershellise-keybindings

A Visual Studio Code extension that configures PowerShell ISE keybindings.
TypeScript
4
star
94

PSPackageProject

PowerShell
4
star
95

Compliance

3
star
96

.github

3
star
97

ISEAddOnExamples

3
star
98

pscore-docs-dotnet

PowerShell
2
star
99

JsonAdapterFeedbackPredictor

1
star