@Ponkam, Sumanth (Cognizant), You cannot directly pass variables/values from one inlinescript to another inlinescript in PowerShell workflows. To achieve this requirement, a variable at workflow scope is required which can be accessed through $using
scope modifier.
The following example workflow shows a sample scenario:
workflow test
{
$a = 0 #variable at workflow scope
$a = InlineScript
{
$b = 3;
$b #returned value gets assigned to workflow variable "$a"
}
$a = InlineScript
{
$b = $Using:a - 1;
$b
}
Write-Output "New value of variable 'a' = $a"
}
test
For more details, see variables in InlineScript
Hope this helps.
If the answer did not help, please add more context/follow-up question for it. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.