Run non-admin scripts with correct execution policy
This commit is contained in:
parent
cbbfcdcf5e
commit
28d9364afb
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue