6

I want to deploy a database project "database.dbproj" (for example) using powershell. So far, I tried to deploy project using following methods,

$msbuild = 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe'

$option1 = @(' /t:reBuild,deploy /p:TargetConnectionString="Data Source=(local)\SQL2008R2;Integrated Security=True;Pooling=False;" /p:TargetDatabase=test "C:\TEMP\SVN\6000\Database\Database.dbproj"')

& $msbuild $option1

And

$test1 = @(' /target:Build,deploy','C:\TEMP\SVN\6000\Database\Database.dbproj','/property:TargetConnectionString="Data Source=(local)\SQL2008R2;Integrated Security=True;Pooling=False;"','/property:TargetDatabase=test')

& $msbuild $test1

and

$test2 = $msbuild +"" + $option1

Invoke-Expression $test2

But in all cases it doesn't do anything. I mean if I debug the code then I can see that this pointer reaches to this command and then simply moves to next line of command without doing anything. I have similar Batch script, and it works just fine. So I am sure that it is some noob mistake that is causing this issue. What is wrong I am doing here ?

Thanks, Jack

1 Answer 1

6

Try the following:

Start-Process -FilePath "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" -ArgumentList "/t:reBuild,deploy /p:TargetConnectionString=`"Data Source=(local)\SQL2008R2;Integrated Security=True;Pooling=False;`" /p:TargetDatabase=test `"C:\TEMP\SVN\6000\Database\Database.dbproj`""
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.