This script exports every unmanaged solution in a Dataverse environment and unzips each into its own folder. Commit them for a baseline; every later run shows what changed. Handy when you inherit an environment someone else built: the maker portal only exports one at a time.

What it does

  1. Runs pac solution list against your active auth profile and saves it to solutions-list.txt.
  2. Warns if line five doesn’t start with Unique Name: wrong environment, or the CLI output changed.
  3. Skips managed solutions and Default, which can’t be exported.
  4. Exports the rest with pac solution export --name (unmanaged by default).
  5. Unzips each into a folder named after the solution and deletes the zip.

$skipExisting = $true at the top keeps folders you already have and only fetches new solutions. The default re-exports everything.

Before you run it

The repo version

dataverse-solution-scanner does the same with more:

  • Multiple environments from config/environments.json, checked against a schema, into solutions/<name>/.
  • Keeps each zip under _backups, ready for pac solution import.
  • Unzips canvas apps (.msapp) too, so they diff.
  • Needs PowerShell 7.

Its security-scan.ps1 runs regex rules over the exports. It’s a demo, and the README says not to rely on it; use TruffleHog or Kingfisher.

What it misses

  • Unpublished changes. Exports only include published components. pac solution publish fixes that, but publishes everyone’s work in progress.
  • Anything only in Default.
  • Data. Solutions carry customisations, not records.
  • Tidy diffs. It uses Expand-Archive. pac solution unpack gives a file per component, which Microsoft prefers. For canvas apps only the *.pa.yaml under Src belong in source control.
  • A sturdy parser. It counts lines in a table meant for people. --json would be better.
  • Secret scrubbing. Exports can hold keys. Check before committing anywhere shared, or pasting into an AI tool.

For a development Managed Environment, Dataverse Git integration is the built-in way to keep solutions in an Azure DevOps Git repo, in a YAML format that diffs far better. Microsoft says dev only, not test or production. The script still works when you just want a copy of what’s there.

Thumbnail: Photo by Centre for Ageing Better on Pexels

© 2026 Ali Robertson · Accessibility · Melbourne, Australia · · ·

Thanks for exploring this site with a screen reader! On mobile: use the rotor or local context menu to navigate by headings and landmarks. On desktop: press ? to see all keyboard shortcuts.