mirror of
https://github.com/microsoft/PowerToys
synced 2024-11-22 00:03:48 +00:00
[ARM][Settings][CmdNotFound]Fix CmdNotFound page init (#32892)
On ARM, process does not inherit environment, so PATH variable only contains SYSTEM values. As pwsh.exe path is in USER PATH, check requirements script on CmdNotFound page load will fail and as a result all requirements will be shown as missing. Therefore, on loading, we manually set PATH variable, same as we do after installing pwsh7.
This commit is contained in:
parent
e1832a0a4a
commit
c601a3e3e2
@ -58,6 +58,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_enabledStateIsGPOConfigured = true;
|
||||
}
|
||||
|
||||
// Update PATH environment variable to get pwsh.exe on further calls.
|
||||
Environment.SetEnvironmentVariable("PATH", (Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine) ?? string.Empty) + ";" + (Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.User) ?? string.Empty), EnvironmentVariableTarget.Process);
|
||||
|
||||
CheckCommandNotFoundRequirements();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user