Passing account credentials into custom script

I’d like to create a custom script in Octopus that triggers a build via the TeamCity REST API. To do that I need to provide a username and password to authenticate against TeamCity (Basic Auth).

I’ve created a username/password account in Octopus to store these credentials however there doesn’t seem to be a way to use these in a powershell script.

Is there any way to get at these? Or is there some other way of passing credentials securely into powershell scripts? I guess as soon as they would be available in a script someone can write a script to echo them out in a build log so they’re kind of implicitly insecure at that point anyway :frowning:

Hi,

Unfortunately accounts are not exposed to scripts, so the way to pass a username + password is to create 2 variables, the username as a regular text variable and the password as a sensitive variable (https://octopus.com/docs/deploying-applications/variables/sensitive-variables)

Cheers
John