dataverse-solution-scanner exports every unmanaged solution in your Dataverse environments and unpacks each into a file per component. 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
For each environment in config/environments.json, backup-solutions.ps1:
- Lists its solutions with
pac solution list --jsonand saves them tosolutions/<name>/solutions.json. - Skips managed solutions and Default, which can’t be exported.
- Exports the rest with
pac solution exportas unmanaged zips under_backups, ready forpac solution import. A failed export is reported and the run carries on. - Unpacks each with
pac solution unpack, a file per component, which is how Microsoft suggests you open a solution zip. - Pulls each canvas app’s Power Fx source (
Src/*.pa.yaml) out of its.msapp. That’s the part that belongs in source control.
-SkipExisting keeps solutions you already have and only fetches new ones. -Publish runs pac solution publish first, since exports only include published components. It publishes everyone’s work in progress, so it’s off by default.
Before you run it
- Install the Power Platform CLI 2 or later (
pac install latest) and PowerShell 7. pac auth createwith an account that can reach every environment you list.- Copy
config/environments.template.jsontoconfig/environments.jsonand give each environment anameand itsguid. The script checks the file against its schema before it starts; VS Code checks it as you type.
security-scan.ps1 runs regex rules over the backup. It’s a demo, and the README says not to rely on it; use TruffleHog or Kingfisher.
What it misses
- Anything only in Default.
- Data. Solutions carry customisations, not records.
- 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 better still. Microsoft says dev only, not test or production. The script works anywhere you can sign in, when you just want a copy of what’s there.