Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Users have to download the shell script, make it executable and available in a directory that can be accessed by the Agent.

Download: JS7 - Download (Section: Utilities, Unix: js7.encryption.tar.gz, Windows: js7.encryption.zip)

The job performs the following operations:

...

Code Block
languagebash
titleShell implementation to update the business date with a Job Resource variable
linenumberstrue
#!/bin/sh

$HOME/js7_set_job_resource.sh \
    --url=http://joc-2-0-primary:7446 \
    --controller-id=testsuite \
    --user=root:root \
    --job-resource=/ProductDemo/Variables/pdBusinessDate \
    --key=businessDate \
    --value=$(date +'%Y-%m-%d')

...

  • Consider use of the following shebang in the first line of the job script:
    @@setlocal enabledelayedexpansion & @@findstr/v "^@@f^@@[fs].*&" "%~f0" | pwshpowershell.exe -NonInteractive -Command - &goto:eof& exit !errorlevel!/b&
  • The PowerShell executable pwsh.exe is available starting from PowerShell 6.0. PowerShell releases 5.x use the executable powershell.exe that can be used accordingly with the shebang.
  • For details about the PowerShell shebang see the JS7 - How to run PowerShell scripts from jobs article.

...