Hi Octopus Team:
I have a script that runs perfectly fine using script console, but failed when run the script within a deployment step.
Below is the script:
$octopusURI = “octopus server url”
$apiKey = ‘API key’
$octoExePath = “C:\Program Files\Octopus Deploy\Tentacle\Octo.exe”
& $octoExePath create-release --project ‘Reports 3.0.0’ --server $octopusURI --apiKey $apiKey
Got error: & : The term ‘C:\Program Files\Octopus Deploy\Tentacle\Octo.exe’ is not recognized as the name of a cmdlet, function
if I change the last two lines to:
cd $octoExePath
./Octo.exe create-release --project ‘Reports 3.0.0’ --server $octopusURI --apiKey $apiKey
Got error: cd : Cannot find path ‘C:\Program Files\Octopus Deploy\Tentacle’ because it does not exist
Both of those two scenarios works fine in script console, this is really weird behavior.
Please help, thanks in advance.
Jian