9

tl;dr How to force Powershell to skip checking for a new release?

When I start Powershell 7, it checks for a new version of Powershell.

Currently, this looks like

PowerShell 7.0.0
Copyright (c) Microsoft Corporation. All rights reserved.

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

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

This check for a new release delays the start of Powershell. Sometimes this delay is ten to twenty seconds. It's mildly annoying. I'd like to skip the powershell release check.

JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
  • 1
    I'm having the issue with 7.2.6 on a server with no Internet connection even after adding the UPDATE and OPTOUT system environment variables: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350. No matter what I do, PS7 wants to contact ctldl.windowsupdate.com upon startup, delaying the command prompt anywhere from 3-10 seconds. – Erik Anderson Sep 14 '22 at 17:26
  • 1
    @ErikAnderson I've noticed some changes in the 7.2 series and 7.3 series. The Answers below worked when I tried them for Powershell 7.0. It _seems_ the Powershell team has added _more_ checks that require contacting servers across the Internet. :-/ (I have not fully investigated this, just noticed some oddities in passing) The Answers below were correct for 7.0 Powershell. The Answers below need some additions for 7.2 Powershell. – JamesThomasMoon May 12 '23 at 19:46

2 Answers2

9

The accepted answer works for me, but with some adjustments.

Setting $env:POWERSHELL_UPDATECHECK = 'Off' in the PS profile $profile didn't disable the update checks.

I had to set the environment variable through system dialog: enter image description here

After setting the variable this way PS no longer hangs looking for the new version:

PowerShell 7.1.0
Copyright (c) Microsoft Corporation.

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

PS7 >
JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
Pak Uula
  • 2,750
  • 1
  • 8
  • 13
  • 1
    Yes, the official documentation only mentions this solution: "The update notification behavior can be changed using the POWERSHELL_UPDATECHECK environment variable. The following values are supported: Off turns off the update notification feature" https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_update_notifications?view=powershell-7.3 – JanosLaszlo Feb 01 '23 at 20:57
3
$env:POWERSHELL_UPDATECHECK = 'Off'

By default, PowerShell subscribes to one of two different notification channels depending on its version/branch. Supported, Generally Available (GA) versions of PowerShell only return notifications for updated GA releases. Preview and Release Candidate (RC) releases notify of updates to preview, RC, and GA releases.

The update notification behavior can be changed using the POWERSHELL_UPDATECHECK environment variable. The following values are supported:

Off turns off the update notification feature
Default is the same as not defining POWERSHELL_UPDATECHECK:
GA releases notify of updates to GA releases
Preview/RC releases notify of updates to GA and preview releases
LTS only notifies of updates to long-term-servicing (LTS) GA releases

The change to $env:POWERSHELL_UPDATECHECK can be added to the Profile script at $profile.

notepad $profile

Source: https://toastit.dev/2020/03/13/ps7now-update-notifications/

JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94