none
Powershell DTSX package execution - receiving error on connection string RRS feed

  • Question

  • All,

    I'm having trouble getting a dtsx package to execute in powershell.

    I have used the execute package utility to create the following command line. This executes from the command prompt without issue. Allowing me to replace the two the connection strings in the connection managers.

    dtexec.exe /FILE "Data.dtsx\"" /CONNECTION DW;"\"Data Source=<servername>;User ID=<userid>;Password=<password>;Initial Catalog=<dbname>;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=False;\"" /CONNECTION SourceDB;"\"Data Source=<servername>;User ID=<userid>;Pass
    word=<password>;Initial Catalog=<dbname>;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=false;\""  /CHECKPOINTING OFF  /REPORTING EW

    When I attempt to run the above in powershell, I'm given an error on the first connection string:

    At line:1 char:60
    + dtexec.exe /F "Data.dtsx" /Conn Dashboard;"\"Data Source=<server name>
    +                                                            ~~~~
    Unexpected token 'Data' in expression or statement.
    At line:1 char:71

    I'm guessing this has to do with the space but I was under the impression that the back slash prior to the Data Source token was an escape character. 

    I have looked for the solution in other posts but my example seems to reflect the solution posted .So is there something additional that needs to be done for a powershell execution or what am I missing?

    • Moved by ArthurZ Monday, July 7, 2014 8:38 PM Does not appear SSIS related
    Monday, July 7, 2014 6:08 PM

All replies

  • I vaguely remember I dealt with this issue a long time ago and solve it (it wasn't a package), then posted here http://geekswithblogs.net/Compudicted/archive/2011/09/11/how-to-run-a-powershell-script-in-command-line-both.aspx

    See if this helps, otherwise I suspect I need to move this thread to the PoweShell forum.


    Arthur My Blog

    Monday, July 7, 2014 7:10 PM
  • Thanks for the response Arthur.

    I have the package executing from the cmd line without issue but I can't seem to get the proper format for powershell. It looks similar to a post you created: 

    SSIS Package execution error from powershell 

    The powershell forum maybe where this belongs.

    Dirk

    Monday, July 7, 2014 7:20 PM