Hi!
Im building a little app, and im want it to open our ExchangeManagementShell from inside the code if a checkbox i selected.
I have a scortcut on desktop to open this normaly, and im trying to copy what its opening:
im trying to to this:
And when at first get this working, i want to add a line and run there.
What am i doing wrong here?
Im building a little app, and im want it to open our ExchangeManagementShell from inside the code if a checkbox i selected.
I have a scortcut on desktop to open this normaly, and im trying to copy what its opening:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell "
im trying to to this:
C#:
var ps1File = @"'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'";
var startInfo = new ProcessStartInfo()
{
FileName = "powershell.exe",
Arguments = $"-noexit -command . \"{ps1File}\"; Connect-ExchangeServer -auto -ClientApplication:ManagementShell ",
//UseShellExecute = false
};
Process.Start(startInfo);
And when at first get this working, i want to add a line and run there.
What am i doing wrong here?