SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Run SSIS package from Powershell


Run SSIS package from Powershell

Author
Message
gary.mazzone
gary.mazzone
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2632 Visits: 692
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:TonguelanID].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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search