locked
Powershell for pass comma separated list RRS feed

  • Question

  • Hi All,

    I have a requirement, we need to pass comma separated list using powershell script.

    How can we achive the above scenario?

    Thanks in Advance...

    Tuesday, September 8, 2015 11:09 AM

Answers

  • You need to create a package scope variable to receive the list from the agent job ([Set values] to pass to the package variable).  You need to configure  an Execute Process Tasks' Arguments to use the parameter to run the powershell.

    In your powershell script, you can use an array parameter to accept this list and use it in a loop.

    Let me know if you need  more help.

    • Proposed as answer by Eric__Zhang Wednesday, September 9, 2015 1:30 AM
    • Marked as answer by Eric__Zhang Thursday, September 17, 2015 9:27 AM
    Tuesday, September 8, 2015 2:41 PM

All replies

  • Not clear; pass where to?

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Tuesday, September 8, 2015 11:22 AM
  • Hi Olaf,

    Thanks for quick response...

    We are created a job with powershell script. In script, we need to pass comma separated list.

    How can we pass the comma separated list. ?

    Thanks in Advance....

    Tuesday, September 8, 2015 11:42 AM
  • You need to create a package scope variable to receive the list from the agent job ([Set values] to pass to the package variable).  You need to configure  an Execute Process Tasks' Arguments to use the parameter to run the powershell.

    In your powershell script, you can use an array parameter to accept this list and use it in a loop.

    Let me know if you need  more help.

    • Proposed as answer by Eric__Zhang Wednesday, September 9, 2015 1:30 AM
    • Marked as answer by Eric__Zhang Thursday, September 17, 2015 9:27 AM
    Tuesday, September 8, 2015 2:41 PM