Pass values from an external powershell script to an inline script

• Domanda

• 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.

Tim

venerdì 18 ottobre 2019 15:10

Tutte le risposte

• 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!

(79,108,97,102|%{[char]$_})-join'' venerdì 18 ottobre 2019 15:48 • 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! Thanks Tim venerdì 18 ottobre 2019 21:59 • 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"

lunedì 21 ottobre 2019 16:19
• Hi,