Navigation

    Inedo Community Forums

    Forums

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

    scusson_9923

    @scusson_9923

    0
    Reputation
    60
    Posts
    14
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    scusson_9923 Follow

    Best posts made by scusson_9923

    This user hasn't posted anything yet.

    Latest posts made by scusson_9923

    • RE: Otterscript: Usage of Success exit code or EXEC operation - clarifications

      Hi Alana,

      This seems to work for what I am trying to accomplish.

      Thanks!

      Scott

      posted in Support
      S
      scusson_9923
    • RE: Otterscript: Usage of Success exit code or EXEC operation - clarifications

      Hi Alana,

      What I am trying to do is capture the result (success or fail) of this call:

      InedoCore::Exec
      (
          FileName: pwsh,
          WorkingDirectory: C:\,
          Arguments: test.ps1,
          ErrorOutputLogLevel: Error,
          OutputLogLevel: Information,
          SuccessExitCode: == 0
      );
      

      My understanding is that currently InedoCore::Exec does not have a return value. I was hoping for something like:

      $ret = InedoCore::Exec
      (
       ...
      );
      
      if $ret == "0"
      {
          // do operations for success
      }
      else
      {
         // do operations for failure
      }
      

      Thanks!
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Otterscript: Usage of Success exit code or EXEC operation - clarifications

      Any updates on this?

      Thanks!
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Otterscript: Usage of Success exit code or EXEC operation - clarifications

      @dean-houston Hi Dean,

      I did try setting the return of my PowerShell test script to exit -1 which fails the InedoCore::Exec call as expected. I just need to capture that failure and test on it.

      Thanks,
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Otterscript: Usage of Success exit code or EXEC operation - clarifications

      @dean-houston Hi Dean,

      I am having a difficult time understanding the workflow here.

      As an experiment, I run a ps1 which sets $Fail to "true" as an Ad Hoc job:

      InedoCore::Exec
      (
          FileName: pwsh,
          WorkingDirectory: C:\,
          Arguments: test.ps1,
          ErrorOutputLogLevel: Error,
          OutputLogLevel: Information,
          SuccessExitCode: == 0
      );
      
      if $Fail == "true"
      {
          InedoCore::Send-Email
          (
              ...
          );
      }
      

      I get this: Could not resolve variable $Fail.

      Do you have a working example? I must be missing something.

      Also, what is the purpose of SuccessExitCode if you cannot test on it?

      Thanks!
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Otterscript: Usage of Success exit code or EXEC operation - clarifications

      Hi Alana,

      Are you planning on adding a return value for an Exec operation?  In my job, I call an otter script which calls pwsh via Exec and would like to send an email based on its return (success\failure).
      

      Thanks!
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Working Rafts_CreateOrUpdateRaftItem example for Otter

      Hi Dean,

      Setting RaftItemType_Code = 7 in this instance worked for me. Appreciate the list of valid types. Thanks for all of your help!

      Scott

      posted in Support
      S
      scusson_9923
    • RE: Working Rafts_CreateOrUpdateRaftItem example for Otter

      Hi Dean,

      Here is what I'm running:

      Invoke-WebRequest -Method Post -Uri "https://<otter_server>/api/json/Rafts_CreateOrUpdateRaftItem" -Body @{
      API_Key = "<apikey>"
      Raft_Id = 1
      RaftItemType_Code = 4
      RaftItem_Name = "JobConfigs/test.yml"
      ModifiedOn_Date = Get-Date
      ModifiedBy_User_Name = "scusson"
      Content_Bytes = [System.Convert]::ToBase64String([IO.File]::ReadAllBytes("D:\test.yml"))
      }

      If I add the text file (test.yml) thru the UI, it gets added as binary.

      Thanks,
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Working Rafts_CreateOrUpdateRaftItem example for Otter

      Hi,

      This functionality is fixed in 2024.4. However, the script gets created as type "Unknown". How can this be set and what types are valid?

      Thanks,
      Scott

      posted in Support
      S
      scusson_9923
    • RE: Working Rafts_CreateOrUpdateRaftItem example for Otter

      @dean-houston Thanks!

      posted in Support
      S
      scusson_9923