Posted Mon, 13 Aug 2018 20:17:03 GMT by

With the re-branding of AutoMate BPA to AutoMate Enterprise, I figured it would be appropriate to rename the PowerShell module.  Along with this are some pretty serious changes to the module:

  • Most objects have had classes defined for them, and are no longer of the PSCustomObject type.  This allowed me to defined which properties use enums, and makes the display of these objects much more readable.  For example, many objects have a "CompletionState" property (which is the Staging level) that, prior to this version, would simply display a number.  That number corresponded with a staging level, but there was no great way to determine what that level was.  With AutoMatePS, if an object has a staging level of Production, it will say "Production" instead of "2".
  • Adds functions for working with the new Email condition introduced in v11.
  • Adds functions for working with Workflow/Task/Agent properties.
  • Get-AMMetric is a new function for retrieving metrics from AutoMate.
  • Several enhancements to the connection store and connect function:
    • AutoMatePS has been redesigned to allow connections to multiple AutoMate instances running on the same server (in theory, although I don't have this setup, so have been unable to test).  A new -ConnectionAlias parameter has been added to provide a shorthand way to refer to an AutoMate server.  Each connection is now uniquely identified by the hostname and port (PoshBPA only used the hostname) and has a connection alias of <server>:<port> by default, which can be cumbersome to type if you're working frequently with multiple connections.  The connection alias makes this easier.  Most functions have a -Connection parameter that will take either the alias or a connection object.
    • Connect-AMServer now returns a connection object that can be optionally used with the -Connection parameter available on many functions.
    • The connection store now stores the port.  Once a server/port/credential combination is stored in the connection store, only the server needs to be specified to establish connection.  This is convenient for dealing with the port differences between versions.
    • The v11 port (9708) is now the default port used in Connect-AMServer.

One goal with AutoMatePS has been to make it so the user needs to rarely think about which AutoMate version they are working with.  The only times you should have to think about it is when you're connecting, or if you're trying to do something that is unsupported on the version you're connected to.  For example, Email conditions were introduced in version 11, so New-AMEmailCondition would not work on any version 10 servers.  Another example: copying tasks with Copy-AMTask between servers is no longer supported if those servers are of different versions.  This is because the module is not capable of converting between AML versions.

Given that all the functions have been renamed, any scripts that used PoshBPA will need to be modified for AutoMatePS.  Additionally, pay attention to any scripts that work with multiple server connections.  You will need to consider the changes outlined above for connecting to a server.  Single server connections are still as easy as they were with PoshBPA.

To install from the PowerShell gallery:

Install-Module AutoMatePS
Posted Fri, 17 Aug 2018 14:43:29 GMT by

Really nice work!! :)

Posted Tue, 27 Nov 2018 02:24:48 GMT by



Incredible work on AutomatePS!  Is there a function to see what step a running task is on?  I found an API entry that returns this but not sure if it is in AutomatePS as I haven't been able to find it.




Posted Tue, 27 Nov 2018 02:39:12 GMT by

It is possible, but not entirely intuitive.  For some reason, the "instances/list" API method does not return the "CurrentStepNumber" property as expected - I always get 0 when I call it.  However, the "agents/{id}/running_instances/list" API method does return "CurrentStepNumber".  Get-AMInstance was written to account for this, so if you pass an agent in to Get-AMInstance and specify a -Status of Running, it will call the "agents/{id}/running_instances/list" method, which will give you "CurrentStepNumber".  Here's an example of how to call it:

Get-AMAgent "agent01" | Get-AMInstance -Status Running

And here's a partial example of the output:

CurrentFunctionName    : Main
CurrentStepDescription : Completed activity "Wait: For Duration".
CurrentStepNumber : 45

 Thanks for the feedback!

Posted Tue, 27 Nov 2018 02:53:20 GMT by

Clarification - "instances/list", per the documentation, doesn't even return the CurrentStepNumber, CurrentStepDescription and CurrentFunctionName properties, nor does "instances/running/list" (seems like this method should).  So when I stated the I was seeing a value of 0, that's likely AutoMatePS throwing a default value in there, not the API.

Posted Wed, 28 Nov 2018 23:13:51 GMT by


Thanks for the quick response!  I did not get the output you indicated.  Here's what I ran and my output:

get-amagent "USPPAW-BOT01" | get-aminstance -status running

StartDateTime EndDateTime ConstructType ConstructName AgentName Status
------------- ----------- ------------- ------------- --------- ------
11/28/2018 6:00:02 AM 11/28/2018 6:00:02 AM Task CCX - LeadGen - Grab Leads USPPAW-BOT01 Running
11/28/2018 8:08:51 AM 11/28/2018 8:08:51 AM Task Wait 1.5m USPPAW-BOT01 Running

I tried additional piping to see if I could narrow down in the the CCX task but couldn't get anything of value.



Posted Thu, 29 Nov 2018 00:04:21 GMT by

Sorry, my sample command wasn't completely clear.  That will simply return an instance object that has the properties you want.  By default, it will only show you the properties you've shared above, because they provide the most useful information about that instance.  To see all properties of the instance, just pipe into "select *":

Get-AMAgent "USPPAW-BOT01" | Get-AMInstance -Status Running | select *
Posted Thu, 29 Nov 2018 07:05:41 GMT by

Awesome!  Thanks so much!


You must be signed in to post in this forum.