Last active
August 29, 2015 14:28
-
-
Save Dalmirog-zz/5e4a437367141249d4e2 to your computer and use it in GitHub Desktop.
Add an environment to an existing phase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Adding an environment to an existing phase#### | |
$lifecyclename = "" | |
$phasename = "" | |
$environmentID = "" #must be a single value | |
$lifecycle = Get-OctopusLifeCycle -LifeCycleName $lifecyclename -resourceonly | |
$lifecycle.Phases | ?{$_.name -eq $phasename } | %{$_.OptionalDeploymentTargets.Add($environmentID)} #Optional deploy Env | |
#$lifecycle.Phases | ?{$_.name -eq $phasename } | %{$_.AutomaticDeploymentTargets.Add($environmentID)} #Automatic deploy Env | |
Update-OctopusResource -Resource $lifecycle -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment