Powershell script works perfectly fine, when i run through command windows. But through asp.net web page it doesn't. Can anyone give pointers for troubleshooting ... running windows 10
using System.Management.Automation;
using System.Management.Automation.Runspaces;
Runspace runspace = RunspaceFactory.CreateRunspace();
runspace.Open();
Pipeline pipeline = runspace.CreatePipeline();
pipeline.Commands.AddScript("powershell.exe -ExecutionPolicy Unrestricted -file D:\\Files\\Scripts\\Script20180817.ps1 -FilePath " + file);
pipeline.Invoke();
runspace.Close();