# Pass values from an external powershell script to an inline script

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

Tim

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!

(79,108,97,102|%{[char]$_})-join'' 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! Thanks Tim 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,