Skip to content

Getting started

Sergey Zwezdin edited this page Jun 18, 2016 · 2 revisions

You have few options how to transform configuration files with Magic Chunks. It depends on build system you use for your project.

For example we will use Powershell to transform configuration file. To use Magic Chunks download latest release manually or get it directly from Nuget.

Once you have Magic Chunks downloaded you need to import module and run Format-MagicChunks command:

Import-Module .\MagicChunks.psm1

Format-MagicChunks -path C:\sources\project1\appsettings.json -transformations @{
 "ConnectionStrings/DefaultConnection" = "Data Source=10.0.0.5;Initial Catalog=Db1;Persist Security Info=True"
}

That's all you need to transform your files.

The code will vary for different types of build systems, but you will always should provide path to configuration file and key-value collection with transformation items.

To transform config files you can use any approach you like: