Fixed: Executing powershell and python scripts directly in Connect->Custom Scripts

This commit is contained in:
Taloth Saldono
2019-07-02 20:50:32 +02:00
committed by Qstick
parent 086e3b3240
commit b6cc303e1c
2 changed files with 58 additions and 0 deletions
@@ -377,6 +377,16 @@ namespace NzbDrone.Common.Processes
return ("cmd.exe", $"/c {path} {args}");
}
if (OsInfo.IsWindows && path.EndsWith(".ps1", StringComparison.InvariantCultureIgnoreCase))
{
return ("powershell.exe", $"-ExecutionPolicy Bypass -NoProfile -File {path} {args}");
}
if (OsInfo.IsWindows && path.EndsWith(".py", StringComparison.InvariantCultureIgnoreCase))
{
return ("python.exe", $"{path} {args}");
}
return (path, args);
}
}