Skip to content

Automate cmdlet help updates via Git clone and monthly workflow#917

Merged
pkbullock merged 4 commits intomainfrom
copilot/automate-cmdlet-help-update
Jan 11, 2026
Merged

Automate cmdlet help updates via Git clone and monthly workflow#917
pkbullock merged 4 commits intomainfrom
copilot/automate-cmdlet-help-update

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 11, 2026

Manual maintenance of cmdlet help documentation from three upstream repositories (pnp/powershell, pnp/cli-microsoft365, MicrosoftDocs/OfficeDocs-SharePoint-PowerShell) was error-prone and required local repository clones at hardcoded paths.

Changes

  • Git clone approach clones documentation repositories into docfx/help-repos/ during workflow execution (ignored via .gitignore)
  • Get-HelpJson.ps1 now uses $PSScriptRoot for relative paths, removing hardcoded C:\git\readonly\script-samples-help\ dependency
  • Monthly GitHub Action (.github/workflows/update-cmdlet-help.yml) clones repositories and generates PRs when documentation changes

Workflow

schedule:
  - cron: '0 0 1 * *'  # 1st of each month
workflow_dispatch:      # Manual trigger available

The action clones the three repositories using git clone --depth 1, runs Get-HelpJson.ps1, and creates a PR only when help files change. Generated files:

  • powershell.help.json (776 cmdlets)
  • cli.help.json (848 commands)
  • spoms.help.json (287 cmdlets)

Manual usage

mkdir -p docfx/help-repos
cd docfx/help-repos
git clone --depth 1 https://github.com/pnp/powershell.git pnp-powershell
git clone --depth 1 https://github.com/pnp/cli-microsoft365.git cli-microsoft365
git clone --depth 1 https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell.git OfficeDocs-SharePoint-PowerShell
cd ..
pwsh ./Get-HelpJson.ps1

Documentation in docfx/help-repos/README.md covers the git clone workflow and automation details.

Original prompt

This section details on the original issue you should resolve

<issue_title>Automate the cmdlet help update</issue_title>
<issue_description>Idea:

  • Explore the GIT submodule command to link sections of the repo to the help articles in the three (or more) repos where the cmdlet help originates. Other approaches welcomed.
  • Update the Get-HelpJson.ps1 to process from these alternative locations

Public Source Repositories for cmdlet help:

Preferred output from this

  • GitHub Action runs monthly to update the run Get-HelpJson.ps1 to get the links to the documentation
  • Create a PR for human review for the updates</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 11, 2026 11:18
Co-authored-by: pkbullock <8781041+pkbullock@users.noreply.github.com>
Co-authored-by: pkbullock <8781041+pkbullock@users.noreply.github.com>
Copilot AI changed the title [WIP] Automate cmdlet help updates with GitHub Action Automate cmdlet help updates via Git submodules and monthly workflow Jan 11, 2026
Copilot AI requested a review from pkbullock January 11, 2026 11:22
@pkbullock
Copy link
Copy Markdown
Member

@copilot - I want to update this solution to avoid using submodules use git clone instead.

Co-authored-by: pkbullock <8781041+pkbullock@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 11, 2026

@copilot - I want to update this solution to avoid using submodules use git clone instead.

Updated the solution to use git clone instead of submodules. The workflow now clones the three documentation repositories during execution, and the help-repos/ directory is ignored via .gitignore. Changes in commit 51aaa68.

Copilot AI changed the title Automate cmdlet help updates via Git submodules and monthly workflow Automate cmdlet help updates via Git clone and monthly workflow Jan 11, 2026
@pkbullock
Copy link
Copy Markdown
Member

I've reviewed and will see if this generates the files as expected.

@pkbullock pkbullock marked this pull request as ready for review January 11, 2026 20:14
@pkbullock pkbullock merged commit 68c199f into main Jan 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate the cmdlet help update

2 participants