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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user