After opening a PowerShell file within VSCode, I get a notification saying "You have an old version of PowerShell (7.1.0). The current latest release is v7.1.1. Would you like to update the version? (This will close ALL pwsh terminals running in this Visual Studio Code session)." I click "Yes" and the notification says "Downloading PowerShell installer...", then after a few seconds the terminal reloads and the original notification appears stating "You have an old version of PowerShell (7.1.0)..." implying that the update failed.
For reference, I currently have PowerShell 7.1.0 installed with the VSCode PowerShell extension 2020.6.0 and VSCode installed machine wide (in the "C:\Program Files\Microsoft VS Code" directory).
After clicking "Yes" to allow the update, it should update successfully.
The download or installation fails after clicking "Yes", causing the update prompt to reappear.
Thanks @jeffreymcclain could you please provide what version of Windows you are on? Do you also hit this issue if you do not have any terminals open besides VSCode? It would also be interesting to know if you download from the MSI with PowerShell terminals open if you also hit this issue? Thanks
Sure, I'm using Windows 10, v20H2.
I did not have any other terminals open at the time I was trying to update within VSCode.
I did eventually just give up last week and downloaded the 64-bit MSI from the GitHub releases page, which worked fine.
I'm assuming the issue is specific to VSCode's built-in PowerShell updater.
This is happening as well on MacOS 11.2.1 in VSCode.
PS > brew cask upgrade powershell
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 33 formulae.
==> New Casks
curseforge google-drive lightform
==> Updated Casks
Updated 34 casks.
Error: Unknown command: cask
The instructions here appear to be correct https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7.1
The extension is not using the right syntax.
For reference, this also happened with PowerShell update from 7.1.1 to 7.1.2
Thanks everyone, we fire the MSI off as a different process (with no dependency on VSCode), it then blocks on the integrated console, or windows terminal instances.... @TravisEz13 @adityapatwardhan do you have any idea what might be happening at the PowerShell MSI level to kill the install here?
https://github.com/PowerShell/vscode-powershell/blob/7f0b9696d74a6813253ff54f3d64eabd3465b68e/src/features/UpdatePowerShell.ts#L166
@SydneyhSmith If we are able to reproduce this locally, it is possible to add some msi logging by adding this:
msiexec /i <path> /log <logPath>
I've opened https://github.com/PowerShell/PowerShell/issues/14831 to track this in PowerShell, since it can be reproduced without VSCode. (I believe this bug has actually existed for some time). Will close this issue as external since there's nothing the extension itself can do.