PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.72k stars 495 forks source link

Allow Powershell to update automatically in VS Code #3684

Closed VashJuan closed 2 years ago

VashJuan commented 3 years ago

Prerequisites

Summary

Its great Powershell has lots of frequent updates! I just would love to set it to auto update (others obviously may not), so I don't have to click through to the info page, then to the download page, then download and install it. With the download its a minute or two of lost productivity, every time, plus a couple minutes for the Admin approval and install process: maybe 5 minutes total distraction...

I'd love to have a "Keep Powershell always up to date" option, or at least a one-click install. It currently looks like:

PowerShell 7.1.5
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

   A new PowerShell stable release is available: v7.2.0 
   Upgrade now, or check out the release page at:       
     https://aka.ms/PowerShell-Release?tag=v7.2.0

I'm on Win 10, on the Insider Edition.

This WAS https://github.com/microsoft/vscode/issues/136782, but they pointed the finger at you all...

Proposed Design

No response

VashJuan commented 3 years ago

Dang, I just noticed this screen during the most recent Powershell update. I don't recall seeing it before. Maybe my answers have just been answered?! Maybe not.

image

JustinGrote commented 3 years ago

@VashJuan Microsoft Update support is brand new in 7.2, but yes, this answers your ask I think, it's better for the system to do it than vscode as vscode may be running without admin rights and you need to install as admin.

o-l-a-v commented 3 years ago

Or you could use the Microsoft store version.

https://www.microsoft.com/en-us/store/apps/9mz1snwt0n5d

andyleejordan commented 3 years ago

I'd personally prefer to allow the system (either Microsoft Update or the Microsoft Store) to handle updates to PowerShell, as those are the dedicated, tested, and supported methods. The extension's support is a bit of a hack which just says "hey you're out of date" and then attempts to point you at the right installer. I think the former is ok, but the latter should be replaced with pointers to either of those first two outlined options (or the instructions page for macOS and Linux).

VashJuan commented 3 years ago

@andschwa, I think that is indeed what PowerShell 7.2 has JUST implemented. Nice!

VashJuan commented 2 years ago

OK, for the very latest PowerShell with Visual Studio Code Insiders, Powershell is NO LONGER AUTO-UPDATING in VS Code. Arggg! Instead I just get:

PowerShell 7.2.1 Copyright (c) Microsoft Corporation.

https://aka.ms/powershell Type 'help' to get help.

A new PowerShell stable release is available: v7.2.2 Upgrade now, or check out the release page at:
https://aka.ms/PowerShell-Release?tag=v7.2.2

This is with: Version: 1.66.0-insider (user setup) Commit: eaa2b431ac259fddf5aa11aa53060a9b70068b29 Date: 2022-03-21T07:21:46.936Z Electron: 17.1.2 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Windows_NT x64 10.0.19044

VashJuan commented 2 years ago

I've been being notified of the above upgrade I "should get" by PowerShell in VSCode for a few days. I just manually verified & checked & installed all available updates (on Windows 10, Insiders track), and still am getting 'nagged' by the desired but painful to install update.

Uggg, not a smooth experience...

andyleejordan commented 2 years ago

That looks like a PowerShell prompt, not from the extension...

VashJuan commented 2 years ago

Yep. As I noted at the top, their team (PowerShell) told me to bug your team (VS Code)!!! I'm not sure what the PowerShell extension even is or whether I have it installed. Should I?! (I'll go look...)

andyleejordan commented 2 years ago

@VashJuan I don't think you are using the PowerShell extension. I think you are opening VS Code, and it by default opens your default terminal. On Windows, that's pwsh. So it's starting PowerShell for you (because that's what Code does with its Integrated Terminal) and that PowerShell startup sequence is informing you of the update that's available.

Can you run code --list-extensions --show-versions and post it here?

VashJuan commented 2 years ago

From inside VSCode's terminal Window:

PS D:\Projects\RangerTrak\rangertrak> code --list-extensions --show-versions code: The term 'code' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. PS D:\Projects\RangerTrak\rangertrak>

I also tried that outside VS Code in 1) a command window, 2) a V Studio Pro command window, 3) a bash window, but it must not be on the path?

From a Powershell prompt: PS C:\WINDOWS\system32> code --list-extensions --show-versions code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

PS C:\WINDOWS\system32>

PS D:\Projects\RangerTrak\rangertrak> "C:\Users\John\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe" --list-extensions --show-versions ParserError: Line | 1 | … osoft VS Code Insiders\Code - Insiders.exe" --list-extensions --show- … | ~~~ | Unexpected token 'list-extensions' in expression or statement.

PS D:\Projects\RangerTrak\rangertrak>

From VSCode's Extension Pane I do show 107 extensions.

VashJuan commented 2 years ago

Ah, here it is: PS D:\Projects\RangerTrak\rangertrak> code-insiders --list-extensions --show-versions 42Crunch.vscode-openapi@4.9.3 aaron-bond.better-comments@2.1.0 adrianwilczynski.csharp-to-typescript@1.12.1 ahmadawais.shades-of-purple@6.13.0 akamud.vscode-theme-onedark@2.2.3 alefragnani.project-manager@12.5.0 aljazsim.tsco@1.0.20 Andreabbondanza.iis-express-executer@1.2.5
Angular.ng-template@13.3.0 Archety.material-icons@0.2.0 batisteo.vscode-django@1.10.0 bierner.markdown-preview-github-styles@1.0.1 BillDietrich.linkcheckerhtml@6.3.0 bokuweb.vscode-ripgrep@0.2.2 buianhthang.xml2json@1.2.4 christian-kohler.path-intellisense@2.8.0 codezombiech.gitignore@0.7.0 cyrilletuzi.angular-schematics@5.1.2 DavidAnson.vscode-markdownlint@0.46.0 dbaeumer.jshint@0.11.0 dbaeumer.vscode-eslint@2.2.2 donjayamanne.githistory@0.6.19 DotJoshJohnson.xml@2.5.1 dotup.dotup-vscode-interface-generator@1.0.15 DSKWRK.vscode-generate-getter-setter@0.5.0 eamodio.gitlens-insiders@2022.3.1718 ecmel.vscode-html-css@1.11.0 EditorConfig.EditorConfig@0.16.4 eg2.vscode-npm-script@0.3.24 Equinusocio.vsc-material-theme@33.2.0 equinusocio.vsc-material-theme-icons@2.2.1 esbenp.prettier-vscode@9.3.0 expertly-simple.ng-evergreen@2.1.1 file-icons.file-icons@1.0.29 firefox-devtools.vscode-firefox-debug@2.9.6 formulahendry.docker-explorer@0.1.7 ghaschel.vscode-angular-html@1.7.0 GitHub.vscode-pull-request-github@0.38.1 GrapeCity.gc-excelviewer@4.2.53 GregorBiswanger.json2ts@0.0.6 Gruntfuggly.todo-tree@0.0.215 hediet.debug-visualizer@2.3.0 hediet.realtime-debugging@0.1.0 hediet.vscode-drawio@1.6.4 hoovercj.vscode-power-mode@3.0.2 idleberg.icon-fonts@2.5.3 Janne252.fontawesome-autocomplete@1.3.1 jebbs.plantuml@2.17.2 johnpapa.angular-essentials@13.0.0 johnpapa.Angular2@13.0.0 johnpapa.pwa-tools@0.1.0 johnpapa.vscode-peacock@4.0.1 johnpapa.winteriscoming@1.4.4 jtlowe.vscode-icon-theme@1.6.6 jumpinjackie.vscode-map-preview@0.5.9 liximomo.sftp@1.12.10 loiane.ts-extension-pack@0.3.0 lukas-tr.materialdesignicons-intellisense@4.0.0 mhutchie.git-graph@1.30.0 MikeBovenlander.formate@1.2.1 mkloubert.vscode-kanban@1.32.0 ms-dotnettools.csharp@1.24.1 ms-python.python@2022.2.1924087327 ms-python.vscode-pylance@2022.3.2 ms-toolsai.jupyter@2022.2.1030672458 ms-vscode-remote.remote-containers@0.228.0 ms-vscode-remote.remote-wsl@0.66.0 ms-vscode.cpptools@1.8.4 ms-vscode.powershell-preview@2022.3.0 ms-vscode.vscode-typescript-next@4.7.20220320 ms-vscode.vscode-typescript-tslint-plugin@1.3.3 msjsdiag.debugger-for-edge@1.0.15 msoffice.microsoft-office-add-in-debugger@0.3.0 nobuhito.printcode@3.0.0 nrwl.angular-console@17.14.1 numso.prettier-standard-vscode@0.9.2 oleg-shilo.codemap@1.16.2 pdconsec.vscode-print@0.9.14 PKief.material-icon-theme@4.14.1 pmneo.tsimporter@2.0.1 PowerQuery.vscode-powerquery@0.1.29 PrateekMahendrakar.prettyxml@1.4.0 PrateekMahendrakar.resxpress@4.4.0 rbbit.typescript-hero@3.0.0 redhat.vscode-yaml@1.5.1 ritwickdey.LiveServer@5.7.5 RobbOwen.synthwave-vscode@0.1.11 ryu1kn.partial-diff@1.4.3 saekiraku.rainbow-fart@1.4.1 SAPOSS.xml-toolkit@1.1.0 sdras.night-owl@2.0.1 solnurkarim.html-to-css-autocompletion@1.1.2 spences10.vba@1.7.1 stringham.move-ts@1.12.0 techer.open-in-browser@2.0.0 theleewise.dnn-theming-snippets@0.0.6 tonybaloney.vscode-pets@1.10.0 VisualStudioExptTeam.vscodeintellicode@1.2.17 vsciot-vscode.vscode-arduino@0.4.11 vscode-icons-team.vscode-icons@11.10.0 WallabyJs.quokka-vscode@1.0.451 wgenial.html-snippets@0.1.5 yzhang.markdown-all-in-one@3.4.0 ZainChen.json@2.0.2 zawys.vscode-as-git-mergetool@0.14.0 zhuangtongfa.material-theme@3.13.20 Zim.vsc-docker@0.34.0

PS D:\Projects\RangerTrak\rangertrak>

andyleejordan commented 2 years ago

Ok, you do have ms-vscode.powershell-preview@2022.3.0 (our PowerShell Preview extension) installed. If you're not using it, feel free to uninstall it. But I think you'll still have pwsh integrated VS Code terminals open up and show you that message.

VashJuan commented 2 years ago

Thx! So is this repository for the extension or PWSH itself?! (Sorry if I'm in the wrong place...)

andyleejordan commented 2 years ago

This repo is for the PowerShell extension for VS Code, though the team maintaining the extension are on the PowerShell team too. The repo for PowerShell (the shell, like pwsh.exe) is https://github.com/powershell/powershell 😊

VashJuan commented 2 years ago

Thx, I'll move it to the right place...

o-l-a-v commented 2 years ago

An alternative is to use PowerShell from Microsoft Store, which auto updates.

https://www.microsoft.com/en-us/store/apps/9mz1snwt0n5d

VashJuan commented 2 years ago

Thx @o-l-a-v.

(I've yet to use MS Store, & probably couldn't figure out which of my chaotic set of ~12 MS usernames/passwords/personas to use! Its my little hot button with MS.)

o-l-a-v commented 2 years ago

You don't need an MS account for installing and updating free apps? AFAIK.