1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-18 21:35:27 -04:00

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
parent c71b4bde86
commit df8ca250aa
2 changed files with 58 additions and 0 deletions
@@ -365,6 +365,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);
}
}