Versions Compared

Key

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

...

The JS7 PowerShell Module is available:

  • from the PowerShell Gallery at https://www.powershellgallery.com/packages/JS7

    Code Block
    languagepowershell
    titlePowerShell Gallery
    Find-Module -Name JS7
    Install-Module -Name JS7
  • from GitHub at https://github.com/sos-berlin/js7-cli-powershell
    • Download and extract the JS7 PowerShell Module:
      • to a user's module location, for example for Windows C:\Users\<user-name>\Documents\WindowsPowerShell\Modules\ or /home/<user-name>/.local/share/powershell/Modules for a Linux environment, see $env:PSModulePath for predefined module locations.
      • or to a location that is available for to all users, e.g. C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
      • or to an arbitrary location that is to be specified later on is specified when importing the module.
    • The name of the downloaded archive (.zip, .tar.gz) and the name of included top-level folder might differ according to releases.
      • For a release 2.0.8, the archive name could be js7-cli-powershell-v.2.0.8.zip and the included top-level folder would be js7-cli-powershell-v.2.0.8.
      • Having extracted the archive, rename the top-level folder to JS7. This is required as JS7 is the effective module name.

...

The module supports Windows PowerShell FullCLR 5.1 and PowerShell CoreCLR 6.x and 7.x for Windows, Linux and MacOS environments. It can be used with JS7 releases 2.x. The module is used for the following areas of operation:

  • provide providing bulk operations:
    • select orders and workflows
    • manage orders with operations to the start, stop, suspend operations
    • deploy workflows
  • run running orders and workflows:
    • add orders to workflows
  • manage managing Agents:
    • add Agents to Controllers
    • check Agent status
    • retrieve Agent job execution reports

...

HintYou can add the command Import-Module JS7 to your PowerShell profile to have the module loaded on start of a PowerShell session, see PowerShell CLI 1.1 - Use Cases - Credentials Management.

Use Web Service

As a first operation after importing the module it is required necessary to execute the  Connect-JS7 cmdlet.

  • PS > Connect-JS7 -Url <Url> -AskForCredentials
    • specifies the URL for the JOC Cockpit by which where the JS7 - REST Web Service API is available and asks interactively for credentials. The default JOC Cockpit account is root with the password root.
  • PS > Connect-JS7 <Url> <Credentials> <ControllerId> or PS > Connect-JS7 -Url <Url> -Credentials <Credentials> -Id <ControllerId>
    • -Url: specifies the URL of the JOC Cockpit which is the same URL that you use when opening the JOC Cockpit GUI in your browser, e.g. http://localhost:4446. When omitting the protocol (HTTP/HTTPS) for the URL then HTTP is used.
    • -Credentials: specifies the credentials, for example the user account and password that are used to connect to the JOC Cockpit.
      • A credential object can be created by using keyboard input like this:
        • Set-JS7Credentials -AskForCredentials
      • A credential object can be created like this:
        • $credentials = ( New-Object -typename System.Management.Automation.PSCredential -ArgumentList 'root', ( 'root' | ConvertTo-SecureString -AsPlainText -Force) )
        • The This example makes use of uses the default account root and password root.
        • A possible location for the above code is a user's PowerShell Profile that would be executed for a PowerShell session.
      • Credentials can be forwarded with the -Url parameter like this:
        • Connect-JS7 -Url http://root:root@localhost:4446
        • It is considered insecure to specify account and password with the URL .
      • Find You will find more examples including use of HTTPS connections with SSL certificates from in the JS7 - How to connect to JOC Cockpit using the PowerShell Module article.
    • -Id: specifies the Controller ID that is registered with the JOC Cockpit. As the JOC Cockpit can manage a number of Controllers the -Id parameter can be used to select the respective relevant Controller.
  • The JS7 PowerShell module allows cmdlets to execute cmdlets be executed for the specified JOC Cockpit, Controller and Agents independently from of the server and operating system that the respective JS7 component is operated foron. For example, users can invoke PowerShell cmdlets on Windows to manage a JS7 Controller running on a Linux box and vice versa. As an exception to this rule you cannot start a remote JS7 Controller instance and you cannot start a remote JS7 Windows service, however, you can restart, terminate and abort any JS7 Controller instance on any platform.

...