How to run Powershell scripts in VB.Net How to run Powershell scripts in VB.Net powershell powershell

How to run Powershell scripts in VB.Net


You can run powershell scripts in VB, take a look at the following link

http://blogs.msdn.com/b/zainnab/archive/2008/07/26/calling-a-powershell-script-from-your-net-code.aspx

The link posted above takes you step by step on how to accomplish this.

Check out this question that relates to yours:Running powershell scripts from within a .NET windows app

This following article is in C# but should help you understand the concept a bit better:

http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C


For VB.NET try this code:

Process.Start("powershell", "-File C:\YourFileLocation")

Basically, all you're doing is calling PowerShell and specifying an argument (the location of the cmdlet you're calling).