K2 blackpearl — Goto Activity with PowerShell

Markus Kolbeck
Markus' Blog
Published in
1 min readOct 27, 2017

If you read my post “Call K2 blackpearl SmartObject with PowerShell” you know, that you can use the K2 API within PowerShell quite easily.

https://medium.com/markus-blog/call-k2-blackpearl-smartobject-with-powershell-16f4b210bdc2

You can also manage K2 Process Instances with PowerShell, here is an example how you can change a process instance to go to the desired activity.

When running the script, you have two choices:
1. you can run the script locally on a machine, where the K2 assemblies are registered (e.g. on the K2 Server itself)
2. you can execute the script remotely from any machine and target it to the K2 Server using the Invoke-Command cmdlet

Therefore you will have to save the PowerShell script and then use the following command to execute it remotely:

Invoke-Command -ComputerName YOUR_K2Server -FilePath C:\temp\ManageProcInst.ps1

--

--