I've seen a number of example scripts online that use this. Most recently, I saw it in a script on automating TFS:
[string] $fields = "Title=$($taskTitle);Description=$($taskTitle);Assigned To=$($assignee);"
$fields += "Area Path=$($areaPath);Iteration Path=$($iterationPath);Discipline=$($taskDisciplineArray[$i]);Priority=$($i+1);"
$fields += "Estimate=$($taskEstimateArray[$i]);Remaining Work=$($taskRemainingArray[$i]);Completed Work=$($tasktaskCompletedArray[$i])"
From what I can tell, $($taskTitle)
seems to be equivalent to $taskTitle
. Am I missing something? Is there any reason to use the parentheses and extra dollar sign?
question from:
https://stackoverflow.com/questions/13615676/what-does-variablename-mean-in-expandable-strings-in-powershell 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…