# Export every Dataverse solution with one PowerShell script

> A PowerShell script that uses the Power Platform CLI to export and unzip every unmanaged solution in a Dataverse environment, what it does step by step, and what it misses.

Source: https://ali.id.au/blog/back-up-every-dataverse-solution/ (last edited 2026-10-16)

[This script](https://gist.github.com/alirobe/17864cb8336ea9dc3d4da61fb5d6a596) 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](https://learn.microsoft.com/power-apps/maker/data-platform/export-solutions#export-from-power-apps).

## What it does

1. Runs [`pac solution list`](https://learn.microsoft.com/power-platform/developer/cli/reference/solution#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](https://learn.microsoft.com/power-apps/maker/data-platform/export-solutions).
4. Exports the rest with [`pac solution export --name`](https://learn.microsoft.com/power-platform/developer/cli/reference/solution#pac-solution-export) (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

- Install the [Power Platform CLI](https://learn.microsoft.com/power-platform/developer/cli/introduction).
- [`pac auth create`](https://learn.microsoft.com/power-platform/developer/cli/reference/auth#pac-auth-create), then [`pac env select`](https://learn.microsoft.com/power-platform/developer/cli/reference/env#pac-env-select). Check `pac env who`: it runs against whatever's active.
- Run it in an empty folder, or one holding only earlier backups. It treats every subfolder as a solution.

## The repo version

[dataverse-solution-scanner](https://github.com/alirobe/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`](https://learn.microsoft.com/power-platform/developer/cli/reference/solution#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](https://github.com/trufflesecurity/trufflehog) or [Kingfisher](https://github.com/mongodb/kingfisher).

## What it misses

- **Unpublished changes.** Exports [only include published components](https://learn.microsoft.com/power-apps/maker/data-platform/export-solutions#export-from-power-apps). [`pac solution publish`](https://learn.microsoft.com/power-platform/developer/cli/reference/solution#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`](https://learn.microsoft.com/power-platform/developer/cli/reference/solution#pac-solution-unpack) gives a file per component, which Microsoft [prefers](https://learn.microsoft.com/power-platform/developer/cli/reference/solution#differences-between-pac-solution-clone-and-export). For canvas apps only the `*.pa.yaml` under `Src` [belong in source control](https://learn.microsoft.com/power-apps/maker/canvas-apps/power-apps-yaml#access-source-code-files).
- **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](https://learn.microsoft.com/power-platform/admin/managed-environment-overview), [Dataverse Git integration](https://learn.microsoft.com/power-platform/alm/git-integration/overview) is the built-in way to keep solutions in an Azure DevOps Git repo, in a [YAML format](https://learn.microsoft.com/power-platform/alm/use-source-control-solution-files#source-control-file-formats) 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.

