I have a program that uses the following code (Simplified)
using (PowerShell powerInstance = PowerShell.Create())
{
powerInstance.AddScript("Set-ExecutionPolicy Unrestricted");
powerInstance.AddScript("Connect-AzureRmAccount");
powerInstance.Invoke();
}
This works fine when and a login popup is shown to enter credentials.
Now I want this program to run after I publish my Web app to azure to do this I added a post publish event in my seperate web project like so
<Target Name="PostAzurePublish" AfterTargets="MSDeployPublish">
<Exec Command="C:\MyProgram.exe"></Exec>
</Target>
The issue here is when I publish the my web App the program that runs the powershell commands runs but hangs indefinitely and the Login popup is not shown. So I am assuming it is just waiting for credentials to be supplied but beacuse the login dialog is never shown it hangs.
Is there a simple way I can get the Login dialog to show in this scenario?