Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best technology to use for automating a task using .net libraries?

Imagine that you need to develop and schedule an application/script to do the following:-

  • Reference one or more .net assemblies
  • Query the API, get some objects
  • for each object call another method in the API

What would you use?

In the past I have created small console applications that do the above, but it seems a bit clumsy and overkill.

I imagine something like PowerShell or IronPython might be a better fit.

Any recommendations?

like image 483
Andrew Rimmer Avatar asked Feb 14 '09 16:02

Andrew Rimmer


3 Answers

Absolutely PowerShell, that's exactly the sort of thing it's designed for.

Here's some useful resources to help you get started:

like image 97
Ash Avatar answered Nov 05 '22 00:11

Ash


One of the advantages of PowerShell is that they've done a lot of work in the background to make things fit together easily, doing implicit type conversions etc to make the output of one program usable as the input to another. And since everything passes objects, you don't have to write text munging code to cobble things together.

I do prefer Python, however, when I'm writing a large amount of original code rather than relying heavily on libraries and gluing together components.

like image 3
John D. Cook Avatar answered Nov 04 '22 23:11

John D. Cook


The problem with application drivers is that they constantly break. Applications are constantly changing their external surface and this wreaks havoc on drivers. Therefore you constantly need to updated parts of the drivers. I find a non-compiled dynamic language is ideal for this as you can quickly make an update and kick off a task.

Powershell is a great technology for this. It is an amazingly flexible and really easy to pick up. It is a mix of compiled and dynamic code. So the more algorithm heavy portions of your driver can be any compiled language and the more fragile and frequently updated pieces can be script. They integrate seamlessly.

I'm an avid Powershell user and really don't have much experience with IronPython (hence my choice). IronPython could also have these features though so if you're more comfortable with that language it's where you should go.

like image 2
JaredPar Avatar answered Nov 05 '22 01:11

JaredPar