我想这样做:
$jobName = ((get-item (get-location)).parent.name).ToUpper()
cd module\build
$current = pwd
$env:APP_HOME_$jobName = $current
但我得到:
Unexpected token 'jobName' in expression or statement.
At line:1 char:23
+ $env:APP_HOME_$jobName <<<< = $current
+ CategoryInfo : ParserError: (jobName:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
如何设置基于另一个变量的环境变量?