I have two tasks:
The 'Set Solution Name does this:
$SolutionName = "UnknownSolution"
Write-Host "::vso[task.setvariable variable=SolutionName;]$SolutionName"
Write-Host "Solution Name: $SolutionName"
Here is the output of this task:
::vso[task.setvariable variable=SolutionName;]UnknownSolution Solution Name: UnknownSolution
The 'Get Solution Name' does this:
$SolutionNameFromTask = "$(SolutionName)"
Write-Host "Solution Name: $SolutionNameFromTask"
Error from this task:
SolutionName : The term 'SolutionName' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At D:\a_temp\8d389e74-a705-4c90-96cb-b36de82d0e87.ps1:5 char:28
- $SolutionNameFromTask = "$(SolutionName)"
-
~~~~~~~~~~~~- CategoryInfo : ObjectNotFound: (SolutionName:String) [], ParentContainsErrorRecordException
- FullyQualifiedErrorId : CommandNotFoundException
The 'Get Solution Name' can't find the "$(SolutionName)" and throws an error. My 'Set Solution Name' must not be creating a variable that can be seen by subsequent tasks. Is this not possible?
