如何在PowerShell中添加Atlassian竹变量?
我很难弄明白这一点,我有以下powershell脚本,简单的一个:如何在PowerShell中添加Atlassian竹变量?,powershell,bamboo,Powershell,Bamboo,我很难弄明白这一点,我有以下powershell脚本,简单的一个: $BambooPath = 'C:\StartFolder\*' $RemoteWebPath = 'C:\DestFolder' Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse 我不想在$BambooPath中将C:\StartFolder*替换为 ${bambon.build.working.directory}*变量…有人知道怎么做吗?如果
$BambooPath = 'C:\StartFolder\*'
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse
我不想在$BambooPath中将C:\StartFolder*替换为
${bambon.build.working.directory}*变量…有人知道怎么做吗?如果您有内联PS脚本,可以在参数字段中指定参数:
-BambooPath ${bamboo.build.working.directory}
并添加您的脚本如下所示
param (
[string]$BambooPath = ""
)
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse
使用下划线而不是点来访问环境变量:
$BambooPath = $Env:bamboo_build_working_directory
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse
它是环境变量吗?在这种情况下$env:bambol.build.working.directory是一个bambor变量,只有$bambor\u build\u working\u directory?再看看这个:嗯,它似乎对我不起作用…:如果我做$ENV:它会复制整个C:Drive:嗯,对不起,我没主意了;我建议你写在竹子论坛上