functions/public/Set-DacPacPublishFile.ps1
function Set-DacPacPublishFile { param ( [Parameter(Mandatory = $true)] [string] $publishFilePath, [Parameter(Mandatory = $true)] [string] $sqlDataDirectory, [Parameter(Mandatory = $true)] [string] $sqlLogDirectory ) $fileName = [io.path]::GetFileName($publishFilePath) [xml]$xml = '<?xml version="1.0" encoding="utf-8"?><Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><ItemGroup><SqlCmdVariable Include="DataMountPoint"><Value>{0}</Value></SqlCmdVariable><SqlCmdVariable Include="LogMountPoint"><Value>{1}</Value></SqlCmdVariable></ItemGroup></Project>' ` -f $sqlDataDirectory, $sqlLogDirectory $xml.InnerXml | Out-File $publishFilePath -Force -Encoding "UTF8" Write-DosMessage -Level "Information" -Message "Creating $fileName" } |