Created
October 8, 2017 00:44
-
-
Save Dalmirog-zz/e642cab7c157d9497b20202aa4baeb33 to your computer and use it in GitHub Desktop.
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
$MyLibrarySet = "MyVariableSet" | |
#Create an instance of a Library Set Object | |
$libraryVariableSet = Get-OctopusResourceModel -Resource LibraryVariableSet | |
#Add mandatory properties to the object | |
$libraryVariableSet.Name = $MyLibrarySet | |
#Create the Library Set | |
New-OctopusResource -Resource $libraryVariableSet | |
#Get variable set asociated with the library variable set created above | |
$variableSet = Get-OctopusVariableSet -LibrarySetName $MyLibrarySet -resourceOnly | |
#Creating a variable | |
$var = New-Object Octopus.Client.Model.VariableResource | |
$var.Name = "MyVar" | |
$var.Value = "A value" | |
#add scope here | |
#Adding var to variable set | |
$variableSet.Variables.Add($var) | |
#Saving variable set | |
Update-OctopusResource -Resource $variableSet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment