Running the API through Powershell - VisualCron - Forum

Community forum

nigelrmtaylor
2012-06-25T07:23:14Z
I'm need to do a bit of API programming and would prefer to do it using powershell rather than though C#. Is there a 'getting started with VC API and Powershell' document anywhere?
Support
2012-06-25T07:31:24Z
No, there is not. It is possible, according to this post:

http://www.youdidwhatwit...raries-in-powershell/538 

But, it won't be very effective as you lose the typed objects and still have to get to know every class you want to use. You will complete this in much less time with pure .NET.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
KJDavie
2013-01-09T03:20:49Z
Here is something to try if you are still interested in powershell.

We are using the API to retrieve VisualCron Variable Values for use in scripts.

Copy both files to a local directory (C:\Batch) on a PC where the VisualCron Client is installed.

In VCAPI_Test.ps1 (~ line 35) replace the IP address with your VisualCron Server (or uncomment and use the Fully Qualified Servername instead if that suits your site.

In VisualCron_API.ps1 (~ line 12 & 13) specify a userID and password to use for your installation.

Give it a run in powershell (I use this one as an integrated environment for development http://powergui.org )

Good Luck
File Attachment(s):
Powershell - VisualCron - API Example.zip (2kb) downloaded 208 time(s).
Support
2013-01-09T08:06:47Z
Great script example - thanks!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bweston
2013-01-16T02:28:33Z
Originally Posted by: Support 

No, there is not. It is possible, according to this post:

http://www.youdidwhatwit...raries-in-powershell/538 

But, it won't be very effective as you lose the typed objects and still have to get to know every class you want to use. You will complete this in much less time with pure .NET.



On a related note to the above, once you have a connection established, it is just as easy to explore what's available as it always is in Powershell.

I put together a quick script that used the API through powershell to get a list of all tasks that are currently running and have been running for longer than they took to run the last time they ran; maybe I should post that here when I have access to it again.

I realized that wasn't nearly as useful as I was thinking it would be after I wrote it, because of the number of tasks we have that run on a short interval to poll for work and complete much faster when there isn't any, but it was a good exercise in understanding the API.
raboof
2014-03-10T19:05:35Z
FWIW, I have published some PowerShell commands to query and automate VisualCron via the API as a gist on github . The script is published under Apache License 2.0. If you enhance the script in reusable ways, consider forking from the gist and contributing back so we can build off each other's efforts.
Support
2014-03-10T20:01:12Z
Originally Posted by: raboof 

FWIW, I have published some PowerShell commands to query and automate VisualCron via the API as a gist on github . The script is published under Apache License 2.0. If you enhance the script in reusable ways, consider forking from the gist and contributing back so we can build off each other's efforts.



Thanks for your work!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Users browsing this topic
Scroll to Top