JosefNemec/Playnite · error · Exception
PowerShell 3.0 or newer is not installed.
Error message
PowerShell 3.0 or newer is not installed.
What it means
Thrown by ExecuteScript when PowerShellRuntime.IsInstalled is false — the host machine lacks PowerShell 3.0+, which Playnite requires to run game install/uninstall/etc. scripts. The message is localized via LOCErrorPowerShellNotInstalled.
Source
Thrown at source/Playnite/GamesEditor.cs:1640
bool global,
GameScriptType type,
Dictionary<string, object> vars = null)
{
if (!execute || script.IsNullOrWhiteSpace())
{
return true;
}
try
{
if (runtime == null)
{
throw new Exception("Cannot execute script, no runtime given.");
}
if (!PowerShellRuntime.IsInstalled)
{
throw new Exception(resources.GetString("LOCErrorPowerShellNotInstalled"));
}
var scriptVars = new Dictionary<string, object>
{
{ "PlayniteApi", Application.PlayniteApiGlobal },
{ "Game", game.GetCopy() }
};
vars?.ForEach(a => scriptVars.AddOrUpdate(a.Key, a.Value));
var expandedScript = game.ExpandVariables(script);
var dir = game.ExpandVariables(game.InstallDirectory, true);
if (!dir.IsNullOrEmpty() && Directory.Exists(dir))
{
runtime.Execute(expandedScript, dir, scriptVars);
}
else
{
runtime.Execute(expandedScript, PlaynitePaths.ProgramPath, scriptVars);
View on GitHub (pinned to 5911f4e964)
Solutions
- Install Windows PowerShell 3.0 or newer (Windows Management Framework) on the host.
- On Wine/Proton, ensure wine-mono/powershell core is available or run on a host with PowerShell.
- Guard UI features that rely on scripts behind a PowerShellRuntime.IsInstalled check so they are disabled gracefully.
Example fix
// before
if (!PowerShellRuntime.IsInstalled) { throw new Exception(resources.GetString("LOCErrorPowerShellNotInstalled")); }
// after — caller-side capability check
if (!PowerShellRuntime.IsInstalled && !script.IsNullOrWhiteSpace()) {
Dialogs.ShowMessage("PowerShell 3.0+ is required to run this game's scripts.", "Unsupported", MessageBoxButton.OK, MessageBoxImage.Warning);
return false;
} Defensive patterns
Strategy: validation
Validate before calling
// Check PowerShell availability before offering script-dependent features.
if (!PowerShellRuntime.IsInstalled) {
Dialogs.ShowMessage("PowerShell 3.0+ is required.", "Unsupported", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
} Type guard
static bool ScriptingAvailable => PowerShellRuntime.IsInstalled;
Prevention
- Disable script-based features in the UI when PowerShellRuntime.IsInstalled is false.
- Document the PowerShell requirement for users on Wine/Proton.
- Detect capability at startup and warn once.
When it happens
Trigger: ExecuteScript is invoked with a non-empty script on a system where PowerShellRuntime.IsInstalled evaluates false (no compatible PowerShell engine detected).
Common situations: Running Playnite on a stripped-down Windows image or under Wine/Proton where PowerShell is absent; PowerShell registry keys damaged; security policy uninstalled Windows PowerShell.
Related errors
- PowerShell 5.1 is not installed.
- LOC.ErrorPowerShellNotInstalled
- Cannot execute script, no runtime given.
- Cannot load script file, uknown format.
- Interactive session is already running
AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13).
Data as JSON: /api/errors/796bef5c9c74ae8c.
Report an issue: GitHub.