Powershell compare script
shaarmar
Posts: 3
I seem to be having issues with a powershell script I modified. I just want it to compare the path of scripts to a target source so it generates a script. this is what I have so far:
I'm getting "database and scripts were identical" after every build.
$SQLCompare="${env:ProgramFiles(x86)}\Red Gate\SQL Compare 11\sqlcompare.exe"# full path $MyServerInstance='NAME OF SERVER' #The SQL Server instance $EmptyPath ="/empty2" $MyScriptsPath = "PATH TO SCRIPTS" $AllArgs = @("/server1:$MyServerInstance", "/Scripts1:$MyScriptsPath ", "/empty2:$EmptyPath") &$SQLCompare $AllArgs if ($?) {'updated successfully'} else {if ($LASTEXITCODE=63) {'Database and scripts were identical'} else {"we had an error! (code $LASTEXITCODE)"}}
I'm getting "database and scripts were identical" after every build.
Comments