Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline nigelrmtaylor  
#1 Posted : Monday, June 25, 2012 8:23:14 AM(UTC)
nigelrmtaylor

Rank: Free support

Joined: 2/8/2012(UTC)
Posts: 3
Location: Monaco

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?
Offline Support  
#2 Posted : Monday, June 25, 2012 8:31:24 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,404

Thanks: 573 times
Was thanked: 326 time(s) in 314 post(s)
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!
Offline KJDavie  
#3 Posted : Wednesday, January 9, 2013 4:20:49 AM(UTC)
KJDavie

Rank: Paid support

Joined: 9/25/2012(UTC)
Posts: 106
Australia
Location: Brisbane,Qld

Thanks: 17 times
Was thanked: 40 time(s) in 27 post(s)
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

Edited by user Wednesday, January 9, 2013 11:44:38 PM(UTC)  | Reason: Not specified

File Attachment(s):
Powershell - VisualCron - API Example.zip (2kb) downloaded 113 time(s).
thanks 3 users thanked KJDavie for this useful post.
Support on 1/9/2013(UTC), osirisja on 1/9/2013(UTC), bbusse on 1/17/2013(UTC)
Offline Support  
#4 Posted : Wednesday, January 9, 2013 9:06:47 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,404

Thanks: 573 times
Was thanked: 326 time(s) in 314 post(s)
Great script example - thanks!
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline bweston  
#5 Posted : Wednesday, January 16, 2013 3:28:33 AM(UTC)
bweston

Rank: Paid support

Joined: 12/14/2012(UTC)
Posts: 50

Thanks: 1 times
Was thanked: 9 time(s) in 8 post(s)
Originally Posted by: Support Go to Quoted Post
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.
Offline raboof  
#6 Posted : Monday, March 10, 2014 8:05:35 PM(UTC)
raboof

Rank: No customer

Joined: 3/6/2014(UTC)
Posts: 1

Was thanked: 1 time(s) in 1 post(s)
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 1 user thanked raboof for this useful post.
Support on 3/10/2014(UTC)
Offline Support  
#7 Posted : Monday, March 10, 2014 9:01:12 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,404

Thanks: 573 times
Was thanked: 326 time(s) in 314 post(s)
Originally Posted by: raboof Go to Quoted Post
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
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.266 seconds.
Scroll to Top