Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Created August 23, 2015 21:36
Show Gist options
  • Select an option

  • Save Dalmirog-zz/41fa30020f5a11695caa to your computer and use it in GitHub Desktop.

Select an option

Save Dalmirog-zz/41fa30020f5a11695caa to your computer and use it in GitHub Desktop.
Create Lifecycle
$lifecycle = New-Object Octopus.Client.Model.LifecycleResource
$lifecycle.Name = "MyLifecycle"
#Default Retention Policy
$lifecycle.ReleaseRetentionPolicy = [Octopus.Platform.Model.RetentionPeriod]::new(0,[Octopus.Platform.Model.RetentionUnit]::Items) #Unlimmited Releases
#$lifecycle.ReleaseRetentionPolicy = [Octopus.Platform.Model.RetentionPeriod]::new(2,[Octopus.Platform.Model.RetentionUnit]::Days) #2 days
$lifecycle.TentacleRetentionPolicy = [Octopus.Platform.Model.RetentionPeriod]::new(0,[Octopus.Platform.Model.RetentionUnit]::Items)
#$lifecycle.TentacleRetentionPolicy = [Octopus.Platform.Model.RetentionPeriod]::new(10,[Octopus.Platform.Model.RetentionUnit]::Days) #10 days
New-OctopusResource -Resource $lifecycle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment