Pass values from an external powershell script to an inline script RRS feed

  • Question

  • Hi, I have a release definition that runs a powershell script in one task and I would like to pass the value of that script to an inline script in another task in the release definition.  I don't know if this can be done, and if it can I don't know how to do it.

    Any advice would be appreciated!


    Friday, October 18, 2019 3:10 PM

All replies

  • Of course you can do. Simply save the output of the one script to a variable and provide it for the other script. ;-)

    Live long and prosper!


    Friday, October 18, 2019 3:48 PM
  • Thank you for your reply.  I am relatively new working with releases and am working with VSTS not Azure.  If you could explain in a little more detail how to do this, or point me to an article that does - I would be very grateful!



    Friday, October 18, 2019 9:59 PM
  • Hi Tim, I don't know how you want to pass the output of first script to another. I am considering that whole output of first script would be passed as a parameter to second script and you can do that as below:

    $FirstScriptResult=Invoke-Expression -Command ".\Path\to\FirstScript.ps1"
    $command= ".\Path\to\SecondScript.ps1 $FirstScriptResult"
    Invoke-Expression -Command "$command"

    Monday, October 21, 2019 4:19 PM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, November 8, 2019 1:34 PM