Navigation

    Inedo Community Forums

    Forums

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. ashah_4271
    A
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    ashah_4271

    @ashah_4271

    0
    Reputation
    8
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    ashah_4271 Follow

    Best posts made by ashah_4271

    This user hasn't posted anything yet.

    Latest posts made by ashah_4271

    • RE: Setting runtime variable from powershell script

      @Dan_Woolf,
      Thanks. This will help me a lot.

      posted in Support
      A
      ashah_4271
    • RE: Setting runtime variable from powershell script

      @Dan_Woolf,
      that seems to be working..
      What does >> mean? I can define multi-line powershell script within that block and then call PSEval to run that code block?

      Thanks a million for your assistance.

      posted in Support
      A
      ashah_4271
    • RE: Setting runtime variable from powershell script

      @Dan_Woolf ,
      I am now getting the following error:

      Error: Unhandled exception: System.Management.Automation.IncompleteParseException: Missing closing ')' in expression.
         at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
         at System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult)
         at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
      --- 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.Extensions.Scripting.PowerShell.PowerShellScriptRunner.<RunAsync>d__27.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.Extensions.Scripting.PowerShell.ExecutePowerShellJob.StandardRunner.<ExecuteAsync>d__25.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.Extensions.Scripting.PowerShell.ExecutePowerShellJob.<ExecuteAsync>d__43.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.Agents.LocalJobExecuter.<ExecuteJobAsync>d__0.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.Extensions.Scripting.Functions.PSEvalVariableFunction.Evaluate(IVariableFunctionContext context)
         at Inedo.BuildMaster.BuildMasterVariableEvaluationContext.<TryEvaluateFunctionAsync>d__11.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.Variables.FunctionTextValue.<EvaluateAsync>d__12.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.Variables.ProcessedString.<EvaluateValueAsync>d__15.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.<EvaluateExpressionAsync>d__76.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.<ExecuteAsync>d__53.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.<ExecuteNextAsync>d__37.MoveNext()
      

      For PSEval, I don't see any issue with ')'.

      Can you please advice.
      Thanks

      posted in Support
      A
      ashah_4271
    • RE: Setting runtime variable from powershell script

      @Dan_Woolf,
      This is what I get:

      Cannot bind argument to parameter 'Name' because it is null.

      Here is my Otter script block looks like

      ##AH:UseTextMode
      
      
      # Call DELETE on ElasticSearch
      with retry = 3
      {
          Execute-PowerShell 'set $indexName = $PSEval((Get-Date).AddMonths(-1).ToString("yyyy.MM.*"));'
          (
              Debug: true,
              Verbose: true
          );
      
          Get-Http $elasticUrl/$indexName
          (
              Method: DELETE
          );
      }
      
      posted in Support
      A
      ashah_4271
    • RE: Built-in Variables and global otter script not working

      Thanks Nanci for your response.
      I exactly don't know how variables are being passed from one step to the other in same block of code to the other. Otter script documentation is not so clear on it.
      I have created separate thread fore that. If you can answer that.
      Setting Runtime Variable From Powershell Script
      Thanks

      posted in Support
      A
      ashah_4271
    • Setting runtime variable from powershell script

      Re: Setting runtime variable from powershell script

      Here is my otter script:

      ##AH:UseTextMode
      
      
      # Call DELETE on ElasticSearch
      with retry = 3
      {
          Execute-PowerShell >>$indexName=(Get-Date).AddMonths(-1).ToString("yyyy.MM.*")
      Write-Host "Index for the last Month is $indexName">>
          (
              Debug: true,
              Verbose: true
          );
      
          Get-Http $elasticUrl/$indexName
          (
              Method: DELETE
          );
      }
      

      I created variable called "$indexName" and "$elasticUrl" in my Settings -> variables
      As seen in my otter script above, I need to pass $indexName from first step to the ohter.

      Thanks

      posted in Support
      A
      ashah_4271
    • Built-in Variables and global otter script not working

      Hi,
      I am trying to create an Automated deployments everyday. For that I have created Automatic trigger to run everyday. For that, we have three choices to either create a new build, execute a custom script and Disabled.
      I couldn't pick Create a new build since there are no active releases. For my deployment, I have to create release and build (that is another question on how can I prevent from release from closing after deployment is complete... so that I can use it for Automatic deployments)
      For my custom script, I have created global otter script as seen below:

      General
      {
      Create-Release
      (
      Application: $ApplicationName,
      Pipeline: $PipelineName
      );
      
      Create-Build
      (
          Application: $ApplicationName
      );
      }
      

      When I use that in my Automatic triggers as custom script, it just doesn't work. Am I using built-in variables correctly?
      when I hard-code application name and pipeline, it works.

      Can you please advice me on that?

      Thanks.

      posted in Support
      A
      ashah_4271
    • Setting runtime variable from powershell script

      Hi,
      I have two two steps otter script plan. They both are in one general block.
      First one is a powershell script where I need to set runtime variable
      Next step is REST HTTP call where I need to use that runtime variable.
      Can someone please tell me how can I do that?

      I was reading document about variables and it even confuses me more:
      https://docs.inedo.com/docs/buildmaster/applications/configuration-variables
      https://docs.inedo.com/docs/executionengine/components/runtime-variables

      Any of these two pages doesn't mention anywhere how can I set variables dynamically through script.

      Thanks

      posted in Support
      A
      ashah_4271