$dbname="my_dbname"; $buildOutput="C:\Powershell\output"; $connStr="Persist Security Info=True;Initial Catalog=""dbname"";Data Source=127.0.0.1;uid=""user"";pwd=""password"";" $pr1="/Action:Deploy"; $pr2="/dd:+"; $pr3="/cs:"+$connStr $pr4="/manifest:"""+$buildOutput+"\"+$dbname+"\"+$dbname+".deploymanifest"" " $pr5="/p:TargetDatabase="""+$dbname+""" " $pr6="/q:+" $ex="C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy\vsdbcmd.exe" #execute the deploy command & $ex $pr1 $pr2 $pr3 $pr4 $pr5 $pr6; #check if succeeded or not if ($?) {Write-Host "database ",$dbname," successfully deployed"} else {Write-Host "deployment for ",$dbname," failed"}