Powershell execute file with path in parameters -


i trying run sqlpackage.exe powershell using variable string sourcefile parameter:

$fileexe = "c:\program files (x86)\microsoft sql server\120\dac\bin\sqlpackage.exe"  & $fileexe /action:publish /sourcefile:$outputvariable\file.dacpac /profile:c:\sql\file.sqldatabase.publish.xml 

where $outputvariable folder containing full path

unfortunately following error:

sqlpackage.exe : *** illegal characters in path. @ c:\powershell\test.ps1:20 char:6 +      & $fileexe /action:publish /sourcefile:$outputvariable\file.dacpac     /profile:c ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo          : notspecified: (*** illegal characters in path.:string) [], remoteexception + fullyqualifiederrorid : nativecommanderror 

i tried surrounding quotes , splitting parameters did not solution. idea?

thanks in advance!

apparently trimming $outputvariable

$outputvariable.trim() 

the problem fixed.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -