locked
Execute Process Task quote encloses arguments RRS feed

  • Question

  • Is there any way to not have SSIS Exceute Process Task quote enclose the arguments?

    This is what the script task is echoing out to me via DTS.Events.FireInformation method - it is in the format I need.

    -File "C:\Development\KP Integration\KP Integration\ADExport.ps1" "C:\Test\ADUsers.csv"

    By the time the Execute Task Component consumes it, it quotes the entire expression. There is a prefix " before -File and a suffix quote at the end of the statement as shown below.

    [Execute Process Task] Error: In Executing "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-File "C:\Development\KP Integration\KP Integration\ADExport.ps1" "C:\Test\ADUsers.csv"" 

    Again, I've verified quotes are in the right places for the arguments, but the script component seems to want to qualify the entire argument string as one long string and not take the value as is, which is causing an exception

    Thanks,

    Morgan

    Wednesday, January 23, 2013 9:48 PM

Answers

  • It's not allowing PowerShell to be invoked with arguments to a script file because the arguments are themselves quoted via the expression (I presume this is where it's happening). Thankfully I can call powershell directly via SQL Agent Job and not be in a bind. I submitted this as a bug to Microsoft on Connect with a repro project.

    Thanks for your time.

    Morgan

    • Proposed as answer by Eileen Zhao Wednesday, January 30, 2013 8:45 AM
    • Marked as answer by Eileen Zhao Friday, February 1, 2013 2:22 AM
    Thursday, January 24, 2013 3:54 PM

All replies

  • The SSIS Exceute Process Task does not quote on its own, it is just what you see in the output Window.

    Carefully revise how you placed the double quotes in the SSIS Exceute Process Task.


    Arthur My Blog

    Wednesday, January 23, 2013 9:55 PM
  • Thanks. I've read as much, but why would the DTS.Events.FireInformation echo out a non-quote enclosed value for the variable? Could it be how the variable is being processed by the expression?

    Thanks,

    Morgan

    Wednesday, January 23, 2013 11:28 PM
  • This appears to be a bug with how the expression is handled in the Exec Process Task.

    Information: 0x0 at Build Path: -File "C:\Test\test.ps1" "C:\argument\path\test.csv"

    Error: 0xC0029151 at Execute Process Task, Execute Process Task: In Executing "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-File "C:\Test\test.ps1" "C:\argument\path\test.csv"" at "".

    Looks like I'll be moving the powershell integration to a step in a SQL Agent task, was trying to keep it contained to a package but it looks like the expression is converted to a literal and quote-enclosing the value rather than passing the value as-is.

    Thursday, January 24, 2013 12:22 AM
  • I'd say it is a subtle bug, but since this text is used to emit informational (status) messages to a console it is not critical, I do not know how this suddenly it became important, do you parse the output window a log? What does it break or stop exactly?


    Arthur My Blog

    Thursday, January 24, 2013 3:40 PM
  • It's not allowing PowerShell to be invoked with arguments to a script file because the arguments are themselves quoted via the expression (I presume this is where it's happening). Thankfully I can call powershell directly via SQL Agent Job and not be in a bind. I submitted this as a bug to Microsoft on Connect with a repro project.

    Thanks for your time.

    Morgan

    • Proposed as answer by Eileen Zhao Wednesday, January 30, 2013 8:45 AM
    • Marked as answer by Eileen Zhao Friday, February 1, 2013 2:22 AM
    Thursday, January 24, 2013 3:54 PM
  • If anyone has more information on this, I'm very interested in hearing what others have run into.  I seem to be encountering the same issue where running the SSIS package from the SQL Agent throws an error referencing DTS_USER.  Running the package interactively in debug mode on the SSIS server works just fine.  

    I'd like to know what kind of manipulation is being done to the expression in the execute process task that is causing this to blow up.

     

    Wednesday, June 25, 2014 7:32 PM