:-) They also realize this is an area of pain, but they are driven by the number of folks are affected by a particular issue. They were quite helpful in showing me the specific incantation of single & double quotes to get the desired result - if you needed to keep the internal double quotes in place. Apparently that isn't necessary because even cmd.exe will strip those out.īTW, hats off to the PowerShell team. It turns out I was trying too hard before to maintain the double quotes around the connection string. Using echoargs you can experiment until you get it right, for example: PS> echoargs -verb:sync "-source:dbfullsql=Data Source=mysource Integrated Security=false User ID=sa Pwd=sapass! Database=mydb " You just replace the EXE file with echoargs - leaving all the arguments in place, and it will show you how the EXE file will receive the arguments, for example: PS> echoargs -verb:sync -source:dbfullsql="Data Source=mysource Integrated Security=false User ID=sa Pwd=sapass! Database=mydb " -dest:dbfullsql="Data Source=.\mydestsource Integrated Security=false User ID=sa Pwd=sapass! Database=mydb ",computername=10.10.10.10,username=administrator,password=adminpass The PowerShell Community Extensions has such a tool. When you invoke an EXE file like this with complex command line arguments it is usually very helpful to have a tool that will show you how PowerShell sends the arguments to the EXE file. If you want PowerShell to interpret the string as a command name then use the call operator (&) like so: PS> & 'C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe'Īfter that you probably only need to quote parameter/argument pairs that contain spaces and/or quotation chars. When PowerShell sees a command starting with a string it just evaluates the string, that is, it typically echos it to the screen, for example: PS> "Hello World"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |