11

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.

2
  • 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: github.com/PowerShell/PowerShell/issues/…. No matter what I do, PS7 wants to contact ctldl.windowsupdate.com upon startup, delaying the command prompt anywhere from 3-10 seconds. Commented Sep 14, 2022 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. Commented May 12, 2023 at 19:46

4 Answers 4

24

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 > 
Sign up to request clarification or add additional context in comments.

3 Comments

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" learn.microsoft.com/en-us/powershell/module/…
Yeah. adding this env variable in profile not works for me on MacOS. anyone else found a solution?
Recently, Microsoft added LTS option for those who use LTS versions of PowerShell. The official doc mentions that POWERSHELL_UPDATECHECK now can get "LTS" value to notify the user about LTS updates only: learn.microsoft.com/en-us/powershell/module/…
4
$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/

1 Comment

Yeah. adding this env variable in profile not works for me on MacOS. anyone else found a solution?
2

The PowerShell documentation describes a System.Environment method on the about_Environment_Variables page. While the examples given on that page use the two-parameter overload, which only affects the current process, there is a three-parameter overload that allows the change to be persisted in the registry for either the user or the machine, i.e.:

[Environment]::SetEnvironmentVariable('POWERSHELL_UPDATECHECK','Off','User') 

or

#Requires -RunAsAdministrator [Environment]::SetEnvironmentVariable('POWERSHELL_UPDATECHECK','Off','Machine') 

Run once, no need to update any profiles. The change should also be reflected in the Environment Variables dialog mentioned in other posts.

Note: The EnvironmentVariableTarget parameter can also take a third value, Process, which is equivalent to the two-parameter method.

Comments

0

This is just an additional option for people in the future who run into the same problem as me. If you are new and too lazy to write boring commands or lines of code, you can check out the steps below 🤓

  1. Search for an environment variable in windows search with keywords like in the picture then click it
  2. Click on the button I marked with an arrow
  3. Click the new button
  4. List item
  5. Write down the variable name with : POWERSHELL_UPDATECHECK and the value is : false

Just search for an environment variable in windows search with keywords like in the picture then click it

click on the button I marked with an arrow

Click the new button

Write down the variable name with : POWERSHELL_UPDATECHECK and the value is : false

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.