This topic is locked

Powershell Script

3/1/2018 11:41:45 AM
ASPRunner.NET General questions
I
i.NoLim author

Hello,
Is it possible to launch a PowerShell script from a "After record added" event? If so, what would that event look like?

Pete K 3/1/2018

The short answer is yes. The long answer is you will need to roll up your sleeves. First of all make sure that the apppool in which your application runs has administrator rights. If that can't be achieved in your hosting environment, you're dead in the water.
Here's a general article on running PS scripts server-side from within an ASP.net app:
http://jeffmurr.com/blog/?p=142
To adapt this to ASPR.net, I'd think you would need to create a function within a custom code file to wrap the code, place that in your source/includes folder, and then call the function from within the appropriate ASPRunner event.
This topic describes my approach to using custom code files in the ASPR.Net framework: http://asprunner.com...stom-functions/
Hope this helps.

I
i.NoLim author 3/2/2018

Thank you very much for both replies, I'm definitely going to take look at these and report back.