Skip to content

Commit

Permalink
feat: Variable type (e.g. Certificate) can now be specified
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtech-vit-deltatre committed Apr 15, 2019
1 parent 85f8dba commit 911c8c4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Octopus-Cmdlets/AddLibraryVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ public class AddLibraryVariable : PSCmdlet
ValueFromPipelineByPropertyName = true)]
public string Value { get; set; }

/// <summary>
/// <para type="description">The type of the variable to create.</para>
/// </summary>
[Parameter(
ParameterSetName = "ByParts",
Mandatory = false,
ValueFromPipelineByPropertyName = true)]
public VariableType Type { get; set; }

/// <summary>
/// <para type="description">The environments to restrict the scope to.</para>
/// </summary>
Expand Down Expand Up @@ -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);
Expand Down
11 changes: 10 additions & 1 deletion Octopus-Cmdlets/AddVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ public class AddVariable : PSCmdlet
ValueFromPipelineByPropertyName = true)]
public string Value { get; set; }

/// <summary>
/// <para type="description">The type of the variable to create.</para>
/// </summary>
[Parameter(
ParameterSetName = "ByParts",
Mandatory = false,
ValueFromPipelineByPropertyName = true)]
public VariableType Type { get; set; }

/// <summary>
/// <para type="description">The environments to restrict the scope to.</para>
/// </summary>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 911c8c4

Please sign in to comment.