This repository contains PowerShell scripts for exporting, unpacking, importing, and publishing Power Platform solutions.
For a full step by step set of instructions see the blog post here:
- Go to https://admin.powerplatform.microsoft.com/environments
- Click on your Dataverse 4 Teams Environment
- Copy tour Environment ID

- Go to https://make.powerapps.com/environments/{copyed Environment ID}/home e.g. https://make.powerapps.com/environments/b50bfa1f-d077-e56f-aeaa-b9f92d3b79ad/home
- Click on Developer resources
- Copy your Web API endpoint e.g.https://orgef4d7f17.api.crm11.dynamics.com/

This script exports a solution from a source environment, generates a solution settings template, and unpacks the solution, including any Canvas Apps it contains.
-solutionName: The name of the solution to export.-exportDirectory: Directory where the solution's zip file will be exported.-sourceEnv: ID of the source environment from which to export the solution.-unpackDirectory: Directory where the solution will be unpacked and Canvas Apps will be processed.
.\pipelineScripts\downloadFromSource.ps1 -solutionName "Dataverse4TeamsDemo" -exportDirectory ".\demo\dataverse4TeamsDemo" -sourceEnv "1838fca4-6258-e6b8-a710-60838df81aa3" -unpackDirectory ".\demo\dataverse4TeamsDemo\unpacked"This script re-packs a previously unpacked solution and imports it into a target environment. If an environment settings file is provided, the import will include those settings.
-solutionName: Name of the solution to be processed.-unpackDirectory: Directory where the solution is unpacked.-environmentSettingsFile: (Optional) Path to the environment settings file.-targetEnvironment: Target environment to which the solution will be imported.-exportDirectory: Directory where the repacked solution will be exported.-Managed: Switch to indicate whether the solution should be managed.
With a settings file:
.\pipelineScripts\releaseToTarget.ps1 -solutionName "Dataverse4TeamsDemo" -unpackDirectory ".\demo\dataverse4TeamsDemo\unpacked" -exportDirectory ".\demo\dataverse4TeamsDemo" -environmentSettingsFile ".\demo\settings.json" -targetEnvironment "5fc7b0a0-dc6e-e682-8886-bad6dac246a7"As Managed:
.\pipelineScripts\releaseToTarget.ps1 -solutionName "Dataverse4TeamsDemo" -unpackDirectory ".\demo\dataverse4TeamsDemo\unpacked" -exportDirectory ".\demo\dataverse4TeamsDemo" -environmentSettingsFile ".\demo\settings.json" -targetEnvironment "5fc7b0a0-dc6e-e682-8886-bad6dac246a7" -managedWithout a settings file:
.\pipelineScripts\releaseToTarget.ps1 -solutionName "Dataverse4TeamsDemo" -unpackDirectory ".\demo\dataverse4TeamsDemo\unpacked" -exportDirectory ".\demo\dataverse4TeamsDemo" -targetEnvironment "5fc7b0a0-dc6e-e682-8886-bad6dac246a7"graph TD
A[Start] --> B[Export Solution]
B --> C[Unpack Solution]
C --> D[Review]
D --> E[Repack Solution]
E --> F[Import Solution]
F --> G[Publish Customizations]
G --> H[End]
You can add this repository as a submodule to your own repository to easily manage and update the scripts.
-
Navigate to the root directory of your target repository.
-
Run the following command:
git submodule add https://github.com/mightora/Power-Paltform-Dataverse4Teams-Tools.git Power-Paltform-Dataverse4Teams-Tools
-
Initialize and update the submodule:
git submodule update --init --recursive
Once added as a submodule, you can run the scripts from their location within your repository.
.\scripts\dataverse4Teams\pipelineScripts\downloadFromSource.ps1 -solutionName "YourSolutionName" -exportDirectory "YourExportDirectory" -unpackDirectory "YourUnpackDirectory".\scripts\dataverse4Teams\pipelineScripts\releaseToTarget.ps1 -solutionName "YourSolutionName" -unpackDirectory "YourUnpackDirectory" -targetEnvironment "YourTargetEnvironmentID"- Ensure you have appropriate permissions and are authenticated with the correct environment before running these scripts.
- Update the paths and parameters according to your specific environment and project setup.