Executing a local PS1 file in Exchange 2010 with VB.NET

tokarbill used Ask the Experts™
I have an Exchange 2007 Management program written in VB.NET.  Many of the PS queries were PS1 files that I create on the fly and execute, redirecting the output to a simple text file.  This all worked just fine.

Now I have to update the tool to work with Exchange 2010.  I am looking for an example of executing a local PS1 file (i.e. c:\temp\myfile.ps1) in a VB.NET environment.  The PS1 file could be something as simple as a single line

get-mailboxpermission -identity me@mine.com  | where {$_.AccessRights -like "FullAccess"} export-csv "c:\temp\output.txt"

Or much more complex.

I know I can run the file interactively, I just can't figure out how to run it programmatically.,


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014


I had already looked at that.  I did do my homework before asking the question.  This was more of a blow off answer.  I'll give the points as I was forced to dig much deeper and solve my own problem.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial