microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.42k stars 6.5k forks source link

Windows store version of powertools fails to install Command Not Found #31935

Open Camios opened 7 months ago

Camios commented 7 months ago

Microsoft PowerToys version

0.79.0

Installation method

Microsoft Store

Running as admin

No

Area(s) with issue?

Command not found

Steps to reproduce

Install powertoys from microsoft store Go to Command Not found It says both dependencies need to be installed First bug. Clicked Install on Powershell 7.4 and nothing happened. Retried and it launched an external window and started installing. Seemed to finish okay. Second bug: clicked install on winget client powershell module and Powershell windows locked up / stopped responding After some time I killed powershell, and then a command window popped up to do something. Third bug: Relaunched powershell and Command Not Found still says the dependencies aren't installed. Open a windows terminal and ran winget install --id Microsoft.Powershell --source winget and it was installed Found an existing package already installed. Trying to upgrade the installed package... So tried hitting install on the Powershell Command Not Found item Fourth bug: the install step thinks powershell is installed in a different directory (I assume this only plagues MS Store installed version).

System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'pwsh.exe' with working directory 'C:\Program Files\PowerToys'. The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.PowerToys.Settings.UI.ViewModels.CmdNotFoundViewModel.RunPowerShellScript(String powershellExecutable, String powershellArguments, Boolean hidePowerShellWindow)PowerShell 7.4 or greater not detected. Installation instructions can be found on https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows 

✔️ Expected Behavior

Command Not Found and its dependencies should install successfully when Powertoys is installed via MS Store

❌ Actual Behavior

Command Not Found and its dependencies don't install successfully when Powertoys is installed via MS Store

Other Software

No response

CharlesHim commented 6 months ago

I have encountered the same issue before and resolved it by following the method below.

Have you been using the system-built-in PowerShell? If so, you can simply download the new version of PowerShell from the Microsoft Store.

Copilot said that the Windows built-in PowerShell usually refers to Windows PowerShell 5.1, while the PowerShell downloaded from the store is often a newer version, such as PowerShell 7.x.

Camios commented 6 months ago

I worked around it by uninstalling the MS store version of Powertoys and installing the non-store version. Then installing the "Command not found" tool with dependencies worked.