Saturday, July 26, 2008

Execute a PowerShell Script from your VB or C# code

Is This Thing On? - Calling a PowerShell Script From Your .NET Code

"Well, Mike F. reminded me to write this article on 5/29 and I am FINALLY getting around to doing it.  I borrow very heavily from the article written by Jean-Paul Mikkers found at: 

http://www.codeproject.com/KB/cs/HowToRunPowerShell.aspx

NOTE:  There is an async version of his code that he does as a follow up.  I don't use it because I want to remove extra code noise to focus on the act of calling the script itself.  If you want to take a stab at the async version (and there are LOTS of good reasons to do so) then you can go here:

http://www.codeproject.com/KB/threads/AsyncPowerShell.aspx

So, on to the goodness!

..."

This is a cool article on how you can call, execute, etc PowerShell from your C# or VB projects. It takes a step by step approach and walks you through it from start to finish.

No comments: