Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

PSCall and OutputAtgument



  • Hi,
    I have a problem with PSCall acting differently in Plans and Roles.
    I have a simple PowerShell script for sorting items:

    param (
        [Parameter(Mandatory = $true)]
        [psobject]
        $List
    )
    $SortedList =  $List | Sort-Object
    

    I also have this simple plan:

    Ensure-Server $ServerName;
    set @UnsortedList = @(item2,item3,item1);
    PSCall Sort-List
    (
        List: @UnsortedList,
        SortedList => @SortedList
    );
    

    It works great and as expected.
    Unfortunately, when I copy the code from this plan into a role that fails with an error:

    Unhandled exception: System.ArgumentException: Cannot assign a Scalar value to a Vector variable.
    at Inedo.ExecutionEngine.Executer.ExecutionOnlyRuntimeVariable..ctor(RuntimeVariableName name, RuntimeValue value)
    at Inedo.ExecutionEngine.Executer.ExecuterThread.InitializeVariable(RuntimeVariableName name, RuntimeValue value)
    at Inedo.ExecutionEngine.Executer.ExecuterThread.ExecuterContext.<SetVariableValueAsync>d__19.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Inedo.ExecutionEngine.Executer.ExecuterThread.ExecuterContext.SetVariableValue(RuntimeVariableName variableName, RuntimeValue variableValue)
    at Inedo.ExecutionEngine.Mapping.CoreScriptPropertyMapper.ReadOutputs(Object target, IEnumerable`1 variables, IExecuterContext executerContext)
    at Inedo.Otter.Service.PlanExecuter.OtterPlanExecuter.<Inedo-ExecutionEngine-Executer-IExecutionHostEnvironment-ExecuteActionAsync>d__57.MoveNext()
    Is there something missing or should it work in both cases?

    Product: Otter
    Version: 2.1.3


  • inedo-engineer

    I'm just following up to see if you were ever able to work-past this, or if it's still an issue?



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation