Octopus Deploy 3.4.13

tommiebags's Avatar

tommiebags

14 Apr, 2017 03:31 PM

Hi,

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?

Thanks,

  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,
    Henrik

  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

  3. Paul Stovell closed this discussion on 24 Jul, 2017 02:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? 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