I am attempting to put together a powershell script that will execute a DTS package. It will be parameter driven, in that I have a text file that contains a variable name and a value pair, and I am processing it within the script. There are three main parameters, ROOT, DtExecutable and DtCommandLine. Within the parameter file, this is what I have entered:
...Executing "C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /FILE "C:\Crossroads\Development\Data Conversion\SQLSCRIPTS\XX Data Conversion\Current\\Extract_Master\Extract_Master.dtsx" /CONFIGFILE "C:\Crossroads\Development\Data Conversion\SQLSCRIPTS\XX Data Conversion\Current\\Extract_Master\Extract_Master.dtsConfig" /CONFIGFILE "C:\Crossroads\Development\Data Conversion\SQLSCRIPTS\XX Data Conversion\Current\\Extract_Master\EtlConnectionManager.dtsConfig" /CONNECTION "XX_EXTRACT";"\"Data Source=LOCALHOST;Initial Catalog=XX_EXTRACT;Provider=SQLNCLI10.1;Integrated Security=SSPI;\"" /SUM /CHECKPOINTING OFF /REPORTING EWDMicrosoft (R) SQL Server Execute Package UtilityVersion 10.50.2500.0 for 32-bitCopyright (C) Microsoft Corporation 2010. All rights reserved.Option "Conversion\SQLSCRIPTS\XX" is not valid.Press Enter to Exit
I am getting the error that "Conversion\SQL...\XX" is not valid. I have tried several different ways of enclosing the values in quotes, but it constantly fails. If I cut the code 'Executing "C:\Program Files ....', remove 'Executing ' and paste it into a command window everything executes fine, so Powershell is apparently doing something with the quotes, and I am too new to it to figure out what that might be.