Octopus Deploy 3.4.13

tommiebags's Avatar


14 Apr, 2017 03:31 PM


From the Octopus Deploy website under Tasks > Script Console, which have used before to deploy one shot maintenance to environments, however, this seemingly harmless script is not outputting the environment variable value for a specific targetted end point

$environment = $OctopusParameters['Octopus.Environment.Name']
Write-Host "Environment: $environment"

End result is the output is blank, was rather expecting the name of the environment for that targetted endpoint.

Am I missing something?


  1. Support Staff 1 Posted by Henrik Andersso... on 18 Apr, 2017 01:05 AM

    Henrik Andersson's Avatar

    Hi Tommie,

    Did this used to work for you when running the script through the Script Console?

    As far as I can remember we've never populated this field as a script run through the Script Console doesn't run in the context of an environment like a deployment of a release does.

    Thank you and best regards,

  2. 2 Posted by tommiebags on 19 Apr, 2017 09:02 AM

    tommiebags's Avatar

    Hi Henrik,

    Many thanks for the response.

    Yes, I do recall being able to execute one shot scripts that referenced the variable through the Script Console.

    Thanks and best regards

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac