concept variable value in category powershell

appears as: variable values, variable value, variable value
Windows PowerShell in Action, Third Edition

This is an excerpt from Manning's book Windows PowerShell in Action, Third Edition.

Variable names vs. variable values

Here’s a tip to keep in mind if you’re trying to do these tricks. You need to keep variable name and variable value firmly separated in your thinking. Remember that $ isn’t part of the variable’s name. It’s part of a token in the PowerShell language indicating that whatever follows the $ is the name of a variable.

Listing 12.5. Using variables in workflows
workflow demo-scope { # This is a workflow top-level variable $a = 22 "Initial value of A is: $a" # Access $a from Inlinescript (bringing a workflow #variable to the PowerShell session) using $using inlinescript {"PowerShell variable A is: $a"} inlinescript {"Workflow variable A is: $using:a"} ## changing a variable value $a = InlineScript {$b = $Using:a+5; $b} "Workflow variable A after InlineScript change is: $a" parallel { sequence { # Reading a top-level variable "Value of A inside parallel is: $a" # Updating a top-level variable with # $workflow:<variable name> $workflow:a = 3 } } "Updated value of A is: $a" } demo-scope