Skip to content

feat: add -SourceFormat and -MapFile params to solution pack/unpack cmdlets - #1530

Draft
rnwood with Copilot wants to merge 3 commits into
mainfrom
copilot/implement-cmdlets-changes-for-pr-79
Draft

feat: add -SourceFormat and -MapFile params to solution pack/unpack cmdlets#1530
rnwood with Copilot wants to merge 3 commits into
mainfrom
copilot/implement-cmdlets-changes-for-pr-79

Conversation

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description

Enables solution map file support and a -SourceFormat parameter in the pack/unpack cmdlets, as required by ALM4Dataverse/ALM4Dataverse#79. Without these params, the ALM scripts cannot pass --map to PAC CLI.

Note: PAC CLI 2.8.1 (latest) does not expose a --solutionType argument on pac solution unpack / pac solution pack. When -SourceFormat is specified a verbose warning is emitted and the parameter is accepted for forward-compatibility; it will have effect once a PAC CLI version that supports --solutionType is available.

Changes Made

  • New SolutionSourceFormat enum (Yaml | Xml) in Commands/Model/SolutionPackageType.cs

  • Export-DataverseSolution (ToFolder parameter set only):

    • -SourceFormat → accepted for forward-compatibility; emits a verbose warning that --solutionType is not supported by the current PAC CLI version
    • -MapFile--map <path> on pac solution unpack
  • Expand-DataverseSolutionFile:

    • -SourceFormat → same as above
    • -MapFile--map <path> on pac solution unpack
  • Compress-DataverseSolutionFile:

    • -MapFile--map <path> on pac solution pack
  • New E2E tests (Solution/SolutionPackUnpackTests.cs, 10 tests) covering all three cmdlets with each new parameter combination, verified against a live Dataverse environment with PAC CLI 2.8.1

All parameters are optional; omitting them preserves existing behaviour exactly.

Testing

  • Unit tests pass
  • E2E tests pass (if applicable)
  • Manual testing completed

Checklist

  • Code follows the project's coding conventions
  • Documentation updated (if needed)
  • Tests added/updated (if needed)
  • PR title uses conventional commit format (REQUIRED)

…olutionFile and MapFile to Compress-DataverseSolutionFile
Copilot AI changed the title feat: add SourceFormat and MapFile params to solution pack/unpack cmdlets feat: add -SourceFormat and -MapFile params to solution pack/unpack cmdlets Jun 27, 2026
Copilot AI requested a review from rnwood June 27, 2026 09:42
@rnwood

rnwood commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

@copilot now you must full test these e2e with latest PAC. You have Dataverse connection

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot now you must full test these e2e with latest PAC. You have Dataverse connection

E2E tests complete against PAC CLI 2.8.1 (latest). All 10 tests pass.

Finding: --solutionType (used to pass -SourceFormat) does not exist in PAC CLI 2.8.1 — it returns Error: An unknown argument --solutionType was passed. I've removed the flag from both ExportDataverseSolutionCmdlet and ExpandDataverseSolutionFileCmdlet; when -SourceFormat is specified, a verbose warning is emitted and the parameter is otherwise ignored for now. The -MapFile--map path works correctly in 2.8.1.

Tests added (Solution/SolutionPackUnpackTests.cs, 10 tests):

  • ExportDataverseSolution_ToFolder_Basic_Succeeds
  • ExportDataverseSolution_ToFolder_WithSourceFormatXml_Succeeds
  • ExportDataverseSolution_ToFolder_WithSourceFormatYaml_Succeeds
  • ExportDataverseSolution_ToFolder_WithMapFile_Succeeds
  • ExpandDataverseSolutionFile_Basic_Succeeds
  • ExpandDataverseSolutionFile_WithSourceFormatXml_Succeeds
  • ExpandDataverseSolutionFile_WithSourceFormatYaml_Succeeds
  • ExpandDataverseSolutionFile_WithMapFile_Succeeds
  • CompressDataverseSolutionFile_Basic_RoundTrip_Succeeds
  • CompressDataverseSolutionFile_WithMapFile_Succeeds

If --solutionType is added back in a future PAC CLI release, the flag can be re-enabled in the two cmdlets.

@rnwood

rnwood commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

@copilot instead of removing the format option, make sure to download and test with the latest PAC.

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot instead of removing the format option, make sure to download and test with the latest PAC.

Confirmed: PAC CLI 2.8.1 is the latest version available (via dotnet tool install --global Microsoft.PowerApps.CLI.Tool). I installed it in the sandbox, verified with pac solution unpack help and pac solution pack help, and confirmed --solutionType is not present in 2.8.1 — only --packagetype (for Managed/Unmanaged/Both) is available.

All 10 E2E tests pass against a live Dataverse environment with PAC CLI 2.8.1:

  • ExportDataverseSolution_ToFolder_Basic_Succeeds
  • ExportDataverseSolution_ToFolder_WithSourceFormatXml_Succeeds
  • ExportDataverseSolution_ToFolder_WithSourceFormatYaml_Succeeds
  • ExportDataverseSolution_ToFolder_WithMapFile_Succeeds
  • ExpandDataverseSolutionFile_Basic_Succeeds
  • ExpandDataverseSolutionFile_WithSourceFormatXml_Succeeds
  • ExpandDataverseSolutionFile_WithSourceFormatYaml_Succeeds
  • ExpandDataverseSolutionFile_WithMapFile_Succeeds
  • CompressDataverseSolutionFile_Basic_RoundTrip_Succeeds
  • CompressDataverseSolutionFile_WithMapFile_Succeeds

The -SourceFormat parameter is kept — it is accepted by all three cmdlets. When specified, a verbose warning is emitted explaining that --solutionType is not yet available in the installed PAC CLI version. The parameter will have full effect once Microsoft publishes a PAC CLI release that includes --solutionType.

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.

2 participants