You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Read this page and look at the formulations. "Customer can change it", sounds like an internal description for someone at Microsoft. A heading "TODO" indicates that this page is work in progress. "I am not sure how are we going to generate Job ref name, ..." sounds like an internal note to developers.
Versions
4.251.0, Microsoft Windows Server 2019, 10.0.17763
Environment type (Please select at least one enviroment where you face this issue)
Self-Hosted
Microsoft Hosted
VMSS Pool
Container
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
No response
Version controll system
No response
Relevant log output
2025-02-10T13:55:40.0440914Z ##[section]Starting: Use output variable from first task
2025-02-10T13:55:40.0448978Z ==============================================================================
2025-02-10T13:55:40.0449322Z Task : PowerShell
2025-02-10T13:55:40.0449415Z Description : Run a PowerShell script on Linux, macOS, or Windows
2025-02-10T13:55:40.0449574Z Version : 2.247.1
2025-02-10T13:55:40.0449664Z Author : Microsoft Corporation
2025-02-10T13:55:40.0449750Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2025-02-10T13:55:40.0449875Z ==============================================================================
2025-02-10T13:55:41.2476486Z Generating script.
2025-02-10T13:55:41.2999081Z ========================== Starting Command Output ===========================
2025-02-10T13:55:41.3368808Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\c6bf610a-d974-4181-b4ca-bd30a07f0dd3.ps1'"
2025-02-10T13:55:42.0659366Z somevariable : The term 'somevariable' is not recognized as the name of a cmdlet, function, script file, or operable
2025-02-10T13:55:42.0660290Z program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2025-02-10T13:55:42.0660878Z At D:\a\_temp\c6bf610a-d974-4181-b4ca-bd30a07f0dd3.ps1:4 char:59
2025-02-10T13:55:42.0661214Z + ... te-Output "Value of variable set in previous task is $(somevariable)"
2025-02-10T13:55:42.0661496Z + ~~~~~~~~~~~~
2025-02-10T13:55:42.0661781Z + CategoryInfo : ObjectNotFound: (somevariable:String) [], ParentContainsErrorRecordException
2025-02-10T13:55:42.0662880Z + FullyQualifiedErrorId : CommandNotFoundException
2025-02-10T13:55:42.0666873Z
2025-02-10T13:55:42.3382609Z ##[error]PowerShell exited with code '1'.
2025-02-10T13:55:42.4047498Z ##[section]Finishing: Use output variable from first task
The text was updated successfully, but these errors were encountered:
I gave up figuring out how to pass variables between tasks, and came up with the idea to write variables to files instead.
PowerShell Task 1 Inline Script:
Write-Output "Setting a PowerShell variable to some value"
$some_variable = "some value"
Write-Output "Writing some value to a file" (System.DefaultWorkingDirectory)\some_variable.txt"
PowerShell Task 2 Inline Script: (System.DefaultWorkingDirectory)\some_variable.txt"
Write-Output "Value of some variable read from file is $some_variable"
What happened?
I'm trying to figure out how to pass a variable from one PowerShell task to another within the same Azure Release Pipeline. After struggling a lot, I clicked the link by the "Output Variables" -> "Referance name" field, which takes me to this documentation page: https://github.com/Microsoft/azure-pipelines-agent/blob/master/docs/preview/outputvariable.md
Read this page and look at the formulations. "Customer can change it", sounds like an internal description for someone at Microsoft. A heading "TODO" indicates that this page is work in progress. "I am not sure how are we going to generate Job ref name, ..." sounds like an internal note to developers.
Versions
4.251.0, Microsoft Windows Server 2019, 10.0.17763
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
No response
Version controll system
No response
Relevant log output
The text was updated successfully, but these errors were encountered: