Skip to content
Tobias Almén edited this page Jun 9, 2023 · 6 revisions

Arguments

List of available arguments that can be passed when running IntuneCD-startdocumentation.

Argument Description
-p, --path Path to where the backup is saved
-o, --outpath The path to save the document
-t, --tenantname Name of the tenant
-i, --intro Introduction that will be added to the top of the document
-j, --jsondata Lets you configure line 1-4 using a JSON string: "{\"title\": \"demo\", \"intro\": \"demo\",\"tenant\": \"demo\", \"updated\": \"demo\"}"
-m, --maxlength Maximum length of the configuration value, values with a higher count will be displayed with "Value too long to display"
-s, --split Split the documentation into multiple files and create index.md in the configpath directory with a list of all files
-c, --cleanup If set, will remove all table rows with an empty value
-d, --decode If set, will decode all base64 encoded values

Run Documentation locally

In the example below, the documentation will be split into multiple markdown files as -s is specified. This can be useful if the backup is large and the generated markdown file is simply too big.

IntuneCD-startdocumentation -p /tmp/IntuneBackup -s -i "This is an introduction" -t "example tenant" -m 200 -c

The index.md file that was created in "/tmp/IntuneBackup" looks like below,

# Intune Documentation 

This is an introduction

**Tenant:** example tenant

**Document updated on:** 04/01/2023 09:23:48 

## File index 

[index.md](./index.md) 

[Filters.md](./Filters/Filters.md) 

[Apple VPP Tokens.md](./Apple%20VPP%20Tokens/Apple%20VPP%20Tokens.md) 

[Configuration Profiles.md](./Device%20Configurations/Configuration%20Profiles.md) 

[Enrollment Configurations.md](./Enrollment%20Configurations/Enrollment%20Configurations.md) 

[Custom Attributes.md](./Custom%20Attributes/Custom%20Attributes.md) 

[Conditional Access.md](./Conditional%20Access/Conditional%20Access.md) 

[Group Policy Configurations.md](./Group%20Policy%20Configurations/Group%20Policy%20Configurations.md) 

[Settings Catalog.md](./Settings%20Catalog/Settings%20Catalog.md) 

[Management Intents.md](./Management%20Intents/Management%20Intents.md) 

[Managed Google Play.md](./Managed%20Google%20Play/Managed%20Google%20Play.md) 

[Apple Push Notification.md](./Apple%20Push%20Notification/Apple%20Push%20Notification.md) 

[App Configuration.md](./App%20Configuration/App%20Configuration.md) 

[Device Management Settings.md](./Device%20Management%20Settings/Device%20Management%20Settings.md) 

[App Protection.md](./App%20Protection/App%20Protection.md) 

[Proactive Remediations.md](./Proactive%20Remediations/Proactive%20Remediations.md) 

[Apple Enrollment Profiles.md](./Enrollment%20Profiles/Apple/Apple%20Enrollment%20Profiles.md) 

[Windows Enrollment Profiles.md](./Enrollment%20Profiles/Windows/Windows%20Enrollment%20Profiles.md) 

[Compliance Policies.md](./Compliance%20Policies/Policies/Compliance%20Policies.md) 

[Message Templates.md](./Compliance%20Policies/Message%20Templates/Message%20Templates.md) 

[Shell Scripts.md](./Scripts/Shell/Shell%20Scripts.md) 

[Powershell Scripts.md](./Scripts/Powershell/Powershell%20Scripts.md) 

[macOS Applications.md](./Applications/macOS/macOS%20Applications.md) 

[iOS Applications.md](./Applications/iOS/iOS%20Applications.md) 

[Android Applications.md](./Applications/Android/Android%20Applications.md) 

[Windows Applications.md](./Applications/Windows/Windows%20Applications.md) 

Run Documentation in a pipeline

This step should be added to the backup pipeline to make sure the Markdown document is updated when configurations change. By default, it writes to the README.md file in the repo, you can change this with the -o option.

- script: IntuneCD-startdocumentation -t $(TENANT_NAME) -i 'This is a demo introduction'
  env:
    REPO_DIR: $(REPO_DIR)
  displayName: Run IntuneCD documentation

Convert to PDF

While IntuneCD does not support converting the markdown files to PDF by itself, there are third party tools available for converting MD to PDF.

One example which has been used by others is md-to-pdf.

If you decide to try md-to-pdf, an example configuration for making the generated PDF look better is provided below,

{
    "stylesheet" : "https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css",
    "css": ".page-break { page-break-after: always; } .markdown-body { font-size: 14px; } .markdown-body table td, .markdown-body table th { word-break: break-all; width: 500px; } .markdown-body table td { table-layout: fixed; } .markdown-body table tr { page-break-inside: avoid; }",
    "body_class": "markdown-body",
    "marked_options": {
        "headerIds": false,
        "smartypants": false
    },
    "pdf_options": {
        "format": "A4",
        "margin": "10mm",
        "printBackground": false,
        "timeout": 0
    },
    "stylesheet_encoding": "utf-8"
}

You can use the above configuration by saving it as a JSON file and then running md-to-pdf like this:

cat file.md | md-to-pdf --config-file path/to/config.json > path/to/output.pdf

Example document

This is how the generated documentation looks like,

Group Policy Configurations

Demo

setting value
Display Name Demo
Role Scope Tag Ids 0
Policy Configuration Ingestion Type builtIn
Definition Values createdDateTime: 2022-06-05T20:36:36.4666666Z
enabled: True
configurationType: policy
id: 1e45974c-ae79-4a2e-9aa2-1d4f345ff2c7
lastModifiedDateTime: 2022-06-05T20:36:36.5144682Z
definition:
    classType: machinedisplayName: Allow cookies on these sitesexplainText: NonecategoryPath: NonesupportedOn: NonepolicyType: admxIngestedhasRelatedDefinitions: FalsegroupPolicyCategoryId: b00b9099-d1e4-4304-ae72-66f35b450079minDeviceCspVersion: 5.0minUserCspVersion: Noneversion: 1.0id: 7a4581f0-7796-4e1d-8ab0-3132cc9f84f8lastModifiedDateTime: 0001-01-01T00:00:00Z
presentationValues:
    @odata.type: #microsoft.graph.groupPolicyPresentationValueList
    lastModifiedDateTime: 2022-06-05T20:36:36.5144682Z
    createdDateTime: 2022-06-05T20:36:36.51Z
    id: b1ef30e4-fce1-46ee-8aef-c67f335fd82c
    values: presentation:
      @odata.type: #microsoft.graph.groupPolicyPresentationListBoxlabel: Allow cookies on these sitesid: 5b54dad0-cf38-4915-84dc-813bd9f15c41lastModifiedDateTime: 2022-03-15T22:39:00.25ZexplicitValue: FalsevaluePrefix:


createdDateTime: 2022-06-05T20:22:27.94Z
enabled: True
configurationType: policy
id: 465dcc28-02f9-4d8a-9206-0df096b7338e
lastModifiedDateTime: 2022-06-05T20:22:27.9485365Z
definition:
    classType: machinedisplayName: Always render print jobs on the serverexplainText: NonecategoryPath: NonesupportedOn: NonepolicyType: admxBackedhasRelatedDefinitions: FalsegroupPolicyCategoryId: 97016207-bd7e-4c8e-9854-7a6a97ccaefbminDeviceCspVersion: 10.0minUserCspVersion: Noneversion: 1.0id: 7f9ff23c-d53d-4982-a144-98d70b8ad6b4lastModifiedDateTime: 0001-01-01T00:00:00Z
presentationValues: