Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

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

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 7:42 AM
Points: 1,976, Visits: 552
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;
#"\Package.Variables[User::PlanID].Properties[Value]";"1"
$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"
$command
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.

Thanks
Gary
Post #1435992
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse