I understand how to run Powershell scripts as deployment steps and how to operate on Octopus variables in those scripts. But what if built-in variables do not provide enough information and I need to invoke REST API from that script to get what I need? How shall I invoke Octopus API from the script running on Octopus? Again I know how to invoke Octopus API from the outside script, say from TeamCity. But doing the same from within does not look quite right. For instance, where that script supposed to get access token from? Keep it as Sensitive variable? Is there better way?
Thank you!
Konstantin