Author Posts

January 1, 2012 at 12:00 am

by sqlpadawan at 2013-02-21 11:09:42

I'm having trouble with spaces in the args.


# sql server 2008 path
$DTSPath = (Get-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\100\SSIS\Setup\DTSPath").'(default)'

#C:\Program Files\Microsoft SQL Server\100\DTS\Binn\
$BinnPath = = $DTSPath + "BINN\"

#C:\Program Files\Microsoft SQL Server\100\DTS\Packages\
$PackagePath = $DTSPath + "Packages\"

$BinnPath = $DTSPath + "BINN\"
$PackagePath = $DTSPath + "Packages\"

$cmd = $BinnPath + "dtutil.exe"
$arg1 = "-file C:\Users\bullenkr\Documents\Visual Studio 2008\Projects\TestDeployment\TestDeployment\bin\Deployment\TestDeployment.dtsx"
$arg2 = "-copy FILE`;$PackagePath\TestDeployment.dtsx'";

& $cmd $arg1 $arg2;

Write-Host $LastExitCode;

When I run it, it pops an error on $arg1;

Option "Studio" is not valid.
6

I know this should be easy, but I can't seem to get it today.

Any ideas?

by ArtB0514 at 2013-02-21 12:49:39

See if this way (an extra set of quote marks) works:
$arg1 = '-file "C:\Users\bullenkr\Documents\Visual Studio 2008\Projects\TestDeployment\TestDeployment\bin\Deployment\TestDeployment.dtsx"'