I am trying to run a powershell script(script is used to updated a excel sheet data) in .net web api project as mantioned bellow,
var ps1File = @"C:\ActiveLKTel.ps1";
var startInfo = new ProcessStartInfo()
{
FileName = "powershell.exe",
Arguments = $"-NoProfile -ExecutionPolicy unrestricted \"{ps1File}\"",
UseShellExecute = false
};
Process.Start(startInfo);
This works fine when I run .net web api project in localhost, but this does not work when I deploy the .net web api project in IIS
Can someone tell me how to resolve this problem?