abvogel / Microsoft.Xrm.DevOps.Data

This library provides an easy way to generate filtered data compatible with the Configuration Data Migration Tool. These zip files can be used to push specific records between Dynamics 365 environments using the Dynamics 365 Package Deployer.
MIT License
28 stars 5 forks source link

Feature: Work with local data files, merge them through pipeline #26

Open janis-veinbergs opened 10 months ago

janis-veinbergs commented 10 months ago

Currently Merge-CrmDataPackage with pipeline works in a way that all piped packages get appended single AdditionalPackage.

I'd like improve command by allowing piping any number of CrmDataPackage and it will append in an order how items enter within pipeline.

That would allow me having many data projects locally that I want to merge and prepare a .zip for. CRM Packages just flow in and get merged

Get-ChildItem $DataRoot -Recurse -Filter "data.xml" `
    | New-CrmDataPackage `
    | Merge-CrmDataPackage `
    | Export-CrmDataPackage -ZipPath $zipPath

New-CrmDataPackage is also a new command, because I want to get package objects from files within source control and without having to pass a connection to CRM.

Basically I have (or wish to have) a source control structure like this:

Data
  entity1
    data.xml
    data_schema.xml
  configentity
    data.xml
    data_schema.xml
  productcatalog_manyentities
    data.xml
    data_schema.xml

And just pipe up some commands to pack it in a Data.zip for Package Deployer to use.

janis-veinbergs commented 10 months ago

Sorry for bombarding with PRs - however I got everything working (albeit this PR is just convenience, I first implemented them via PS functions) - the comma/dot separator is critical one, otherwise I just cannot use this module :( the m2mrelationships bugfix is just inconvenience and this PR is just convenience.

I was always thinking about not breaking someone's commands and I manually tested that they continue working as they should.