question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell update checker ignores `POWERSHELL_UPDATECHECK` environment variable

See original GitHub issue

System Details

System Details Output

### VSCode version: 1.53.2 622cb03f7e070a9670c94bae1a45d78d7181fbd4 x64

### VSCode extensions:
azsdktm.SecurityIntelliSense@0.8.0     
AzurePolicy.azurepolicyextension@0.1.1 
DotJoshJohnson.xml@2.5.1
eamodio.gitlens@11.2.1
everettjf.filter-line@2.0.1
jinsihou.diff-tool@0.0.1
ms-azure-devops.azure-pipelines@1.183.0
ms-azuretools.vscode-azureappservice@0.21.0
ms-azuretools.vscode-azureresourcegroups@0.3.0
ms-dotnettools.vscode-dotnet-runtime@1.0.0
ms-vscode.azure-account@0.9.6
ms-vscode.powershell@2021.2.2
msazurermtools.azurerm-vscode-tools@0.14.1
ryu1kn.text-marker@1.11.0
Summer.azure-event-hub-explorer@0.1.2


### PSES version: 2.3.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.5
PSEdition                      Core
GitCommitId                    7.0.5
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

I am experiencing a problem with… VS Code notifies as follows…

You have an old version of PowerShell (7.0.5). The current latest release is v7.1.2. Would you like to update the version? (This will close ALL pwsh terminals running in this Visual Studio Code session)

However I have set $Env:POWERSHELL_UPDATECHECK to “LTS” per https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-70?view=powershell-7.1#new-version-notification

Expected Behaviour

I’d expect the notification to only appear when updates to the LTS version of Powershell 7 are available. EG: 7.0.6.

Actual Behaviour

VS Code notifies as follows…

You have an old version of PowerShell (7.0.5). The current latest release is v7.1.2. Would you like to update the version? (This will close ALL pwsh terminals running in this Visual Studio Code session)

Attached Logs

Follow the instructions in the [troubleshooting docs](https://github.com/PowerShell/vscode-powershell/blob/master/docs/troubleshooting.md#logs vscode-powershell.zip vscode-powershell.zip

) about capturing and sending logs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
SydneyhSmithcommented, Mar 9, 2021

Thanks @trolleyboy VSCode does not check for this variable when it runs its update mechanism, but this is a reasonable feature request to add a check for…thanks for catching and reporting this!

2reactions
JustinGrotecommented, Nov 9, 2021

No I’m saying we should have tests to confirm that if we fix it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Windows Updates with PSWindowsUpdate ...
Check Windows Update History with PowerShell (Get-WUHistory); Uninstalling Windows Updates with PowerShell (Remove-WindowsUpdate); How to Hide ...
Read more >
Setting Windows PowerShell environment variables
Other behavior I was looking for: Updates $env:Path so the change takes effect in the current session; Persists the environment variable change ...
Read more >
about Preference Variables - PowerShell | Microsoft Learn
The preference variables affect the PowerShell operating environment and all commands run in the environment. In many cases, the cmdlets ...
Read more >
Set-Content (Microsoft.PowerShell.Management)
Set-Content uses the Path parameter to specify the Notice.txt file and writes the updated content to the file. The last Get-Content cmdlet displays...
Read more >
Get-Service (Microsoft.PowerShell.Management)
Specifies ServiceController objects representing the services to be retrieved. Enter a variable that contains the objects, or type a command or expression that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found