Skip to content

Powershell module documentation

How to add documentation

To include documenation for powershell modules the following should be added to the .gitlab-ci

include:
  ...

  - project: systeembeheer/automation/modules/GitLabHelper
    ref: master
    file: .gitlab/ci-deploy-psmodule-docs.yml

Readme.md

If no Readme.md is present in the module directory, a generic one will be generated with the following structure where Dependencies (Required Modules) are loaded from the Module Manifest

# $projectName
GitLab: Systeembeheer / Automation / Modules / $projectName

## Description
PowerShell module for GitLab integration & automation.

## Platform of the automation
PowerShell Module

## Location of the automation
[GitLab Pipelines](https://gitlab.gentgrp.gent.be/systeembeheer/automation/modules/$projectName/-/pipelines)

## Link to the Code
[GitLab Repository](https://gitlab.gentgrp.gent.be/systeembeheer/automation/modules/$projectName/-/blob/main/.gitlab-ci.yml?ref_type=heads)

## Used Infrastructure

## Dependencies
$requiredModules

Function documentation

Every function should at least have the following values right after the start of the function

function SomePowershellModule{
  <#
      .SYNOPSIS
        Synopsis of the function

      .DESCRIPTION
        Description of the function

      .PARAMETER SomeParameter
        Description of the used parameter(s)

      .EXAMPLE
        PS C:\> Invoke-GitLabProjectDocumentation
        Example of the function

      .EXAMPLE
        PS C:\> Invoke-GitLabProjectDocumentation -OutputPath 'docs'
        Another example of the function with parameters

  #>
  ...
    Powershell code
  ...
}