Passing Octopus variables into scripts by Default

Would it be sensible for information like the environment in Octopus to be passed into the scripts as variables (or does it already do this)?

It is quite a common case for us that we would want to access the Environment in a PowerShell script. I have set up variables in Octopus to do this and this works fine, but I can see it would be a bit of a pain to have to define these for every project and just wondering if it would be generally useful if this kind of thing was passed in by default.

Cheers

Ah, I see some comments in this question http://help.octopusdeploy.com/discussions/questions/19-a-few-questions-on-package-deployment already address this issue.

Hi there,

Good news - the environment is automatically passed through as a variable called “OctopusEnvironmentName”. In PowerShell scripts it will be available as $OctopusEnvironmentName. This is an undocumented feature that was added about a week ago - I’ll try to get the doco up to date soon!

Paul

That works great, thanks!