I wonder if is possible to create a SMO Service instance from the result of a PowerShell script...

  • 19 March 2016
  • 1 reply
  • 3 views

Badge +10

I found the post: 

 

Create Custom BlackPearl SmartObject Service

http://www.astaticstate.com/2007/11/create-custom-blackpearl-smartobject.html

 

Looks really great, and is from almost 10 years ago, I wonder if will be possible now with the current versions to have a template to create a custom PowerShell service instance, where the data is the result provided from the execution of the powershell script. or perhaps reading some static XML or JSON File.

 

Any toughts, ideas welcome.

 

Dino.


1 reply

Badge +10

Yes is possible with "PowerShell Service Object" 

 

http://community.k2.com/t5/K2-blackpearl/PowerShell-Service-Object/ba-p/1025

 

Is awesome... basically need to download the package from the Store:

 

 

1.-        Copy the file “PowerShell.dll” located in the “/bin/Debug” folder of the zipped folder and paste it in the folder “K2 blackpearlServiceBroker” located in your K2 server’s installation path.

 

2.-        Open “SmartObject Service Tester.exe” Located in the “Bin” folder of you K2 server’s installation path

 

⦁3.-        Inside the tester tool, click on “Register ServiceType” button: 

 

⦁4.-        Inside the tester tool, click on “Register Service Instance” button:  [ I use the Service Account ]

 

⦁5.-        Right click on the PowerScript and Register Smart Object” [ I learn the SMO Creation in my case does not have sufficient admin rights... so I run the SMO Creation as K2 Admin and worked perfectly. ]

 

From there you can use the SmartObject tester... and type the script to run. In my case was:

 

          powershell -command e:powershellhelloworld.ps1

 

Where the content of the file is just:

 

          Write-Host "Hello World"

 

Click Execute .... and you will se at the bottom in the return properties "Hello World"

 

With that I can easily create a View:

 

14332iC76359296592DB2A.jpg

 

 

It works great !!!. I wish this is one of the out of the box features for Future K2 Releases. perhaps have some specific folder where tipically scripts can be placed for execution. but right now this is great, because with this you can trigger any Powershell to perform some actions either from the Form or from a Workflow.

 

Enjoy Dino.

 

 

 

 

 

Reply