Docker Desktop window will not show after version 4.10.1 if PowerShell is updated
I have tested with versions 4.10 and 4.11.
Because my PowerShell version was updated to 7+ and the default PowerShell executable name has been changed from powershell.exe to pwsh.exe. Docker Desktop will fail to show the GUI window.
The following log indicates the problem:
[2022-07-31T21:11:23.356663900Z][GoBackendProcess ][Info ] 2022/07/31 15:11:23 notifying bugsnag: exec: "powershell": executable file not found in %PATH%
[2022-07-31T21:11:23.451914800Z][com.docker.backend.exe][F] exec: "powershell": executable file not found in %PATH%
As a workaround, I made a symbolic link to the PowerShell folder by the following PS command: New-Item powershell.exe -ItemType SymbolicLink -Value pwsh.exe in the PowerShell folder C:\Program Files\PowerShell\7
I also supposed that Docker Desktop will keep retrying and accumulating logs due to the fact that re-naming my powershell.exe.bak link to powershell.exe will immediately open up the Docker Desktop window, after I launched Docker Desktop.exe but not killed it in the Task Manager.
thanks for reporting! We have a ticket tracking this internally.
@kl23 Hi, When you upgraded to 7+, did you also remove/uninstall previous powershell?
The default powershell.exe (v 5.1) is a legacy (2016) powershell that is installed by default in windows. Version 7+ (pwsh.exe) is not an update to powershell.exe, it is a new one, replacing, but with some unsupported things from the legacy version, and many new things not in the legacy version.
So, by aliasing pwsh to the legacy version, you risk that some app break, because they will think they invoke the legacy version, but they really call the new version that doesn't re-implement everything the same than the legacy one.
Thanks for reminding, @elapuyade .
As I installed the PowerShell 7 quite long time ago, I don't remember that well.
I performed the update using the .msi installer provided by Microsoft. I still have my 5.1 located in the default folder, but this folder does not exist in the %PATH% environment variable.
You are correct that my workaround risks due to unsupported legacy commands. For example I cannot use mklink to create the symbolic link and it requires the PowerShell command to proceed.
I suppose Docker Desktop could give a better error handling on this issue, such as showing an error prompt or trying to search powershell.exe in the default location.
The legacy location as follow:
| Executable | Path |
|---|---|
| 32-bit (x86) PowerShell executable | %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe |
| 64-bit (x64) Powershell executable | %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe |
OK, so if you still have the 5.1 executable in the default folder, you should better add that location to your PATH and remove the alias.
You are right to say that Docker Desktop should do a better job at informing the user. We are currently working on a global overhaul around error management in general, so things will get better.
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
/lifecycle locked