For a working script, see the script post.
Recently I’ve been working on a PowerShell module called PoshSSDTBuildDeploy that makes use of Microsoft.Data.Tools.MSBuild to build and deploy SSDT-based database projects. And then not long after the fact I started working on functions within the dbatools PowerShell module to deploy dacpacs. In fact here’s the tweet of the announcement –
— dbatools (@psdbatools) December 12, 2017
And here is a link to the source code on GitHub. This is all good stuff because I’ve spoken to a number of people who have written, rewritten and re-rewritten the PowerShell to deploy dacpacs numerous times before, and we’ve all agreed that once is enough. So the fact that there’s a method in a module that is readily available will prevent me from having to re-re-rewrite this again!
There are 3 modules included. I’m going to write a bigger piece about these functions elsewhere, but for now here is a link to the documentation –
WRT PoshSSDTBuildDeploy – I’ll probably take the deploy stuff out of it and just have it as a build module and people can use the stuff what I’ve written in dbatools.
Going forward I’d like to see the ability to update the dac version being used, and also delete those pesky sqlcmdvars that hang around in the change scripts.