Running PowerShell Jobs
JAMS now includes a PowerShell host designed specifically to execute PowerShell scripts under the control of JAMS. We include two new PowerShell execution methods and, as always, it's easy to add your own execution methods so that JAMS works they way you want it to.
JAMS PowerShell Commands
JAMS includes a PowerShell Snap-In with an extensive array of cmdlets that make it easy to control JAMS and your JAMS scripts.
The commands in the JAMS Snap-in include:
| ConvertTo-Date | Converts a natural language date into a specific DateTime |
| Disable-JAMSTime | Disables a JAMS Named Time |
| Disable-JAMSTrigger | Disables a JAMS Trigger |
| Enable-JAMSTime | Enables a JAMS Named Time |
| Enable-JAMSTrigger | Enables a JAMS Trigger |
| Get-JAMSEntry | Gets JAMS Entries |
| Get-JAMSHistory | Gets JAMS History (Are you starting to notice the consistency?) |
| Get-JAMSVariable | Get a JAMS Variable |
| Reset-JAMSTrigger | Resets a JAMS Trigger |
| Restart-JAMSEntry | Restarts a JAMS Entry |
| Resume-JAMSEntry | Resumes a suspended JAMS Entry |
| Set-JAMSEntry | Sets attributes of a JAMS Entry |
| Set-JAMSQueue | Sets attributes of a JAMS Queue |
| Set-JAMSVariable | Sets the value of a JAMS Variable |
| Start-JAMSEntry | Starts a JAMS Entry |
| Start-JAMSQueue | Starts a JAMS Queue |
| Stop-JAMSEntry | Stops a JAMS Entry |
| Stop-JAMSQueue | Stops a JAMS Queue |
| Submit-JAMSEntry | Submits a new JAMS Entry |
| Suspend-JAMSEntry | Suspends a JAMS Entry |
| Wait-JAMSEntry | Waits for the completion of a JAMS Entry |
JAMS PowerShell Provider
JAMS includes a PowerShell Provider which exposes the JAMS objects directly to the PowerShell environment. You can add access a JAMS Service directly with syntax similar to this:
C:\ PS> dir JAMS::servername\
You can simplify that syntax by adding PowerShell drives, like this:
C:\ PS> New-PSDrive JD JAMS servername
Which creates a new PowerShell Drive named JD which points to the JAMS Server on servername. Now, if you do:
C:\ PS> dir JD:
You should get something like this:
Directory: mvpsi.jams\JAMS::servername Name Description ---- ----------- Configuration Configuration Settings Dates Special Date Definitions Menus Menu Definitions Methods Execution Methods Queues Queue Definitions Resources Resource Definitions Systems System Definitions Times Named Time Definitions Triggers Trigger Definitions Variables Variable Definitions
Current JAMS users will recognize those names as JAMS objects and, as you've probably already guessed, your JAMS object definitions can be found beneath those top level directories so, entering:
C:\ PS> dir JD:\Triggers
will show you your JAMS Trigger definitions. Even better, as PowerShell users already know, the "dir" command is actually an alias for Get-ChildItem and what it's actually returning is a collection of JAMS Trigger objects which means it's easy to manipulate and examine them with PowerShell scripts or commands.
For example:
dir JD:\Triggers | sort Description
Gets the collection of Triggers then sorts it by Description.
dir JD:\Triggers | where {$_.Description -like "*way cool*"}
Gets the collection of Triggers then filters the list returning only the Triggers that have "way cool" in their description.
As you can see, PowerShell support adds a lot of power to JAMS.
OpenVMS too!
If you're using JAMS on OpenVMS, you can install the JAMS VMS Connection server and use PowerShell to manipulate JAMS on OpenVMS just like you could if it was running under Windows!