Last active
November 25, 2016 17:16
-
-
Save scottcowan/384088037afda57c91a05a59a3facda7 to your computer and use it in GitHub Desktop.
Move octopus deploy variables between sets
This file contains 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
# setup octoposh first | |
# http://octoposh.net/ | |
$varset = Get-OctopusVariableSet -LibrarySetName "variable set 1" -ResourceOnly | |
$varset2 = Get-OctopusVariableSet -LibrarySetName "variable set 2" -ResourceOnly | |
$vars = $varset.Variables | ?{$_.name.StartsWith("AchievementRate")} | |
foreach ($var in $vars) {$varset2.Variables.Add($var)} | |
Update-OctopusResource -Resource $varset2 | |
# it's important to use resource only or you'll get an error about fixed collection size | |
# this doesn't work for secret variables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment