Hello,
I was wondering if anyone knew how to use a console file in c#. I tried to run the command through pipeline: "powershell -PSConsoleFile \"C:\Program Files\Microsoft\Exchange Server\Bin\exshell.psc1\" -noexit -command \". 'C:\Program Files\Microsoft\Exchange Server\Bin\Exchange.ps1'\""
The issue that I run into is that it brings up the console in my console window and I am not able to run any commands through c# until i exit the console. And then when I try to run the commandlets it cannot find them cause the console was just closed.
So how do I use a console file in C# and run the command ". \"C:\...\""?
Thanks!