Hey guys,
I am having issues tracking down documentation on settings the scope on a VariableResource… I found the powershell way
However getting
$newVariable.Scope.Add([Octopus.Platform.Model.ScopeField]::Environment, (New-Object Octopus.Platform.Model.ScopeValue "Environments-1"))
to translate is not working well.
In my code I am
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)]
public ScopeValue envScope { get; set; }
VariableResource internalVar = new VariableResource();
try
{
if (internalVar == null)
{
internalVar.Name = Name;
internalVar.Value = Value;
if (envScope != null)
{
internalVar.Scope.Add([ScopeField]::Environment, envScope);
}
Any help would be great.