Reputation: 51
I'm having hard times to figure this out, I have the following powershell script , simple one:
$BambooPath = 'C:\StartFolder\*'
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse
I wan't to replace in $BambooPath the C:\StartFolder* with the ${bamboo.build.working.directory}* variable...anyone has an idea how to do that?
Upvotes: 2
Views: 4908
Reputation: 18051
Use underscores instead of dots to access the Bamboo environment variables:
$BambooPath = $Env:bamboo_build_working_directory
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse
Upvotes: 5
Reputation: 1322
If you have inline PS script, you can specify argument (there Argument field):
-BambooPath ${bamboo.build.working.directory}
and add your script should look like
param (
[string]$BambooPath = ""
)
$RemoteWebPath = 'C:\DestFolder'
Copy-Item -Path $BambooPath -Destination $RemoteWebPath -Recurse
Upvotes: 1