Run non-admin scripts with correct execution policy

This commit is contained in:
Pat Hartl 2023-01-16 11:30:53 -06:00
parent cbbfcdcf5e
commit 28d9364afb

View file

@ -17,12 +17,15 @@ namespace LANCommander.PlaynitePlugin
{
var process = new Process();
process.StartInfo.FileName = "powershell.exe";
process.StartInfo.Arguments = $@"-File ""{path}""";
process.StartInfo.Arguments = $@"-ExecutionPolicy Unrestricted -File ""{path}""";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
if (arguments != null)
process.StartInfo.Arguments += " " + arguments;
process.Start();
process.WaitForExit();
}