From 911c8c43a7dcae0995f4002548caab60aa40d597 Mon Sep 17 00:00:00 2001 From: Vojtech Vit Date: Mon, 15 Apr 2019 13:52:55 +0200 Subject: [PATCH] feat: Variable type (e.g. Certificate) can now be specified --- Octopus-Cmdlets/AddLibraryVariable.cs | 11 ++++++++++- Octopus-Cmdlets/AddVariable.cs | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Octopus-Cmdlets/AddLibraryVariable.cs b/Octopus-Cmdlets/AddLibraryVariable.cs index fb4bbfe..6573770 100644 --- a/Octopus-Cmdlets/AddLibraryVariable.cs +++ b/Octopus-Cmdlets/AddLibraryVariable.cs @@ -81,6 +81,15 @@ public class AddLibraryVariable : PSCmdlet ValueFromPipelineByPropertyName = true)] public string Value { get; set; } + /// + /// The type of the variable to create. + /// + [Parameter( + ParameterSetName = "ByParts", + Mandatory = false, + ValueFromPipelineByPropertyName = true)] + public VariableType Type { get; set; } + /// /// The environments to restrict the scope to. /// @@ -181,7 +190,7 @@ private void ProcessByObject() private void ProcessByParts() { - var variable = new VariableResource { Name = Name, Value = Value, IsSensitive = Sensitive }; + var variable = new VariableResource { Name = Name, Value = Value, Type = Type, IsSensitive = Sensitive }; if (Environments != null) AddEnvironments(variable); diff --git a/Octopus-Cmdlets/AddVariable.cs b/Octopus-Cmdlets/AddVariable.cs index 9f5cb60..9f02756 100644 --- a/Octopus-Cmdlets/AddVariable.cs +++ b/Octopus-Cmdlets/AddVariable.cs @@ -66,6 +66,15 @@ public class AddVariable : PSCmdlet ValueFromPipelineByPropertyName = true)] public string Value { get; set; } + /// + /// The type of the variable to create. + /// + [Parameter( + ParameterSetName = "ByParts", + Mandatory = false, + ValueFromPipelineByPropertyName = true)] + public VariableType Type { get; set; } + /// /// The environments to restrict the scope to. /// @@ -190,7 +199,7 @@ protected override void ProcessRecord() private void ProcessByParts() { - var variable = new VariableResource { Name = Name, Value = Value, IsSensitive = Sensitive }; + var variable = new VariableResource { Name = Name, Value = Value, Type = Type, IsSensitive = Sensitive }; if (Environments != null) AddEnvironments(variable);