Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Run SSIS package from Powershell Expand / Collapse
Posted Wednesday, March 27, 2013 9:42 AM


Group: General Forum Members
Last Login: Wednesday, August 3, 2016 6:34 AM
Points: 2,416, Visits: 665
I have the following powershell script:

$html_file_dir = "C:\Scripts"
$cvs_file = "C:\Scripts\SpaceFiles\DiskSpace_20130327060003.csv"
$loadFile = "$cvs_file"
$dbServer = "."
$dbName = "ServerSpaceReports"
#DBServer ,DBName
$constring = "Data Source=$dbServer;Initial Catalog=$dbName;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;"
#Data Source=.;Initial Catalog=ServerSpaceReports;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;
$DTexecPath = "C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec"
#cd $DTexecPath

$setPackageVars = "/Set \Package.Variables[""CSVFile""].Value;" + """$loadFIle"""

$command = " /F C:\scripts\Package.dtsx $setPackageVars"
DTExec.exe $command

When I run this I get an error:
Option " /F C:\scripts\Package.dtsx /Set \Package.Variables[CSVFile].Value;C:\Scripts\SpaceFiles\DiskSpace_20130327060003.csv" is not valid.

If I take the same thing and run it from a command line it runs successfully.

I have no idea why this may be failing can any one help me out.

Post #1435992
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse