Automated Documentation

This guide shows you how to use existing 3rd party Powershell tools to automate the generation of documentation.

M365Documentation

This GH repository streamlines the generation of documentation for Microsoft 365 products.

Installation

Install the following modules from the PowerShell Gallery:

Install-Module MSAL.PS -scope currentuser
Install-Module PSWriteWord -scope currentuser
Install-Module M365Documentation -scope currentuser

Automatic Intune Documentation

  1. Connect and authenticate to the cloud servers.

    Connect-M365Doc
  2. Then you can generate a report for the “Intune Component” of MS365 with this command:

    $doc = Get-M365Doc -Components Intune

    To exclude certain sections such as mobile apps:

    $doc = Get-M365Doc -Components Intune -ExcludeSections "MobileAppDetailed"
  3. Output the documentation to a word file

    $doc | Write-M365DocWord -FullDocumentationPath "$env:USERPROFILE\Downloads\$($doc.CreationDate.ToString("yyyyMMddHHmm"))-Xenter-Documentation.docx"
  4. Install pandoc (required for step 5)

    winget install --source winget --exact --id JohnMacFarlane.Pandoc
  5. Convert from docx to markdown, then upload the audit to the Documentation repository on Github

    pandoc -f docx -t gfm documentation.docx -o documentation.md