Has anyone else encountered a similar problem with the one described below?
I had a problem deploying a dacpac database update for SQL Server 2012 using Powershell. Details are as follows:
Its a dacpac file created for SQL Server 2012, and I'm trying to apply it to the sql server 2012 database through Powershell, which is run from the command line when logged in as an administrator.
The deployment exception is thrown with argument "4": "Unable to determine the identity of the domain." In ... so.ps1: 17 char: 8 + $ d.Deploy ($ dp, $ TargetDatabase, $ true, $ DeployOptions)
The modified script (log and literals changed) is as follows:
[System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\Microsoft.SqlServer.Dac.dll") | Out-Null $d = new-object Microsoft.SqlServer.Dac.DacServices ("... Connection string ...") $TargetDatabase = "databasename" $fullDacPacPath = "c:\temp\...\databasename.dacpac" # Load dacpac from file & deploy to database named pubsnew $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($fullDacPacPath) $DeployOptions = new-object Microsoft.SqlServer.Dac.DacDeployOptions $DeployOptions.IncludeCompositeObjects = $true $DeployOptions.IgnoreFileSize = $false $DeployOptions.IgnoreFilegroupPlacement = $false $DeployOptions.IgnoreFileAndLogFilePath = $false $DeployOptions.AllowIncompatiblePlatform = $true $d.Deploy($dp, $TargetDatabase,$true,$DeployOptions)
Here is some supporting information:
- Dac Frame Version - 11.1
- The script throws an error at startup on the command line:
i.e. Powershell -File databaseupgrade.ps1
but not when run in Powershell script integrated environment - Similar scripts work from the command line for other dacpacs.
Internet research may seem that this may be due to the size of dacpac. Those that work are smaller than the one that doesn't work, and this link mentions a 1.3 MB digit whose file size does not match the duppack. If anyone can confirm that this is a problem, can you also offer a solution?
Update The following scripts demonstrate the same behavior, that is. works in PS. Idea is not from the command line.
[Reflection.Assembly]::LoadWithPartialName("System.IO.IsolatedStorage") $f = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetMachineStoreForDomain(); Write-Host($f.AvailableFreeSpace);
sql-server powershell dacpac
user3177696
source share