Skip to content
microsoft image/svg+xml

GitHub Action

ps-docs

v0.1.0 Latest version

ps-docs

microsoft image/svg+xml

ps-docs

Generate documentation from Infrastructure as Code (IaC) using GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ps-docs

uses: microsoft/ps-docs@v0.1.0

Learn more about this action in microsoft/ps-docs

Choose a version

PSDocs

Generate documentation from Infrastructure as Code (IaC) using PSDocs. PSDocs allows you to dynamically generate markdown from infrastructure code artifacts. Use pre-build modules or build your own.

To learn about PSDocs and how you can build documentation dynamically see Getting started.

Usage

To get the latest stable release use:

- name: Generate docs
  uses: Microsoft/ps-docs@v0.1.0

To get the latest bits use:

- name: Generate docs
  uses: Microsoft/ps-docs@main

For a list of changes please see the change log.

Inputs

- name: Generate docs
  uses: Microsoft/ps-docs@main
  with:
    inputPath: string       # Optional. The path PSDocs will look for files to input files.
    modules: string         # Optional. A comma separated list of modules to use containing document definitions.
    source: string          # Optional. An path containing definitions to use for generating documentation.
    conventions: string     # Optional. A comma separated list of conventions to use for generating documentation.
    outputPath: string      # Optional. The path to write documentation to.
    path: string            # Optional. The working directory PSDocs is run from.
    prerelease: boolean     # Optional. Determine if a pre-release module version is installed.

inputPath

The path PSDocs will look for files to input files. Defaults to repository root.

modules

A comma separated list of modules to use containing document definitions.

Modules are additional packages that can be installed from the PowerShell Gallery. PSDocs will install the latest stable version from the PowerShell Gallery automatically by default. Available modules.

To install pre-release module versions, use prerelease: true.

source

An path containing definitions to use for generating documentation. Defaults to .ps-docs/.

Use this option to include document definitions that have not been packaged as a module.

conventions

A comma separated list of conventions to use for generating documentation.

Conventions are code blocks that provide extensibility and integration. They can be included in .Doc.ps1 files from .ps-docs/ or modules.

See about_PSDocs_Conventions for more information.

outputPath

The path to write documentation to.

path

The working directory PSDocs is run from. Defaults to repository root.

Options specified in ps-docs.yaml from this directory will be used unless overridden by inputs.

prerelease

Determine if a pre-release rules module version is installed. When set to true the latest pre-release or stable module version is installed.

If this input is not configured, invalid, or set to false only stable module versions will be installed.

Using the action

To use PSDocs:

  1. See Creating a workflow file.
  2. Reference Microsoft/ps-docs@main. For example:
name: CI
on: [push]
jobs:
  docs:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout
      uses: actions/checkout@main

    - name: Generate docs
      uses: Microsoft/ps-docs@main
  1. Run the workflow.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Maintainers

License

This project is licensed under the MIT License.