you can use powershell script that will replace the 'templates' with desired values.
[IO.File]::ReadAllText("$DIR\app.template.config").Replace("[MySetting]", $MySettingValue) | Set-Content "$DIR\app.config"
Update
If you want to mix build environments - linux and windows, make sure that you will have a script that either run on both systems (i.e. python) or use powershell or (xor ^_^) sed but make it runnable from both systems using cmd label that is ignored on linux - for more info see i.e. Cross-platform command line script (e.g. .bat and .sh)
example:
:; someLinuxCommand.sh
:; exit
windowsCommandHere.cmd
Single script to run in both Windows batch and Linux Bash?