Skip to content

can not start #28298

Closed as duplicate
Closed as duplicate

Description

@lzb-libra

Prerequisites

Steps to reproduce

I installed the latest version of pwsh using the command "winget install --id Microsoft.PowerShell --source winget". However, this issue occurs every time a new version of pwsh is released on my computer. When I reinstalled the latest pwsh using the command "winget install --id Microsoft.PowerShell --source winget", pwsh could open normally again. But the same problem would occur again when a new version was released.

Image

Expected behavior

normal start

Actual behavior

The startup failed and it cannot be used. Only by installing a new version through a command can it be used normally.

Error details

PowerShell 7.6.8
Process terminated.
totalWidth ('-17') must be a non-negative value. (Parameter 'totalWidth')
Actual value was -17.
   at System.Environment.FailFast(System.Runtime.CompilerServices.StackCrawlMarkHandle, System.String, System.Runtime.CompilerServices.ObjectHandleOnStack, System.String)
   at System.Environment.FailFast(System.String, System.Exception)
   at System.Environment.FailFast(System.String)
   at Microsoft.PowerShell.ManagedPSEntry.Start(System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
System.ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value. (Parameter 'totalWidth')
Actual value was -17.
   at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName)
   at System.String.PadRight(Int32 totalWidth, Char paddingChar)
   at Microsoft.PowerShell.UpdatesNotification.ShowUpdateNotification(PSHostUserInterface hostUI)
   at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, Boolean issProvidedExternally)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)

Environment data

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

Visuals

No response

Activity

  1. added and removed
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Nov 2, 2026
  2. kilasuit commented on Nov 2, 2026

    @kilasuit
    Collaborator

    Your image shows this is running in 7.6.6.

    This issue has been fixed in 7.6.8 onwards by the removal of the code that provided the update notification during startup.

    You can get round this in 7.6.6 by setting the documented env var POWERSHELL_UPDATECHECK to OFF and then upgrading PowerShell.

  3. lzb-libra commented on Nov 3, 2026

    @lzb-libra
    Author

    3. Your image shows this is running in 7.6.6.您的图片显示它运行在 7.6.6 版本上。
    This issue has been fixed in 7.6.8 onwards by the removal of the code that provided the update notification during startup.从 7.6.8 版本开始,这个问题已经通过移除启动时提供更新通知的代码得到了解决。
    You can get round this in 7.6.6 by setting the documented env var POWERSHELL_UPDATECHECK to OFF and then upgrading PowerShell.在 7.6.6 版本中,可以通过将已记录的环境变量 POWERSHELL_UPDATECHECK 设置为 OFF ,然后升级 PowerShell 来解决这个问题。

    The version number in my picture is 7.6.6 because I forgot to take a screenshot at that time, so I used the screenshot from an earlier version. When I opened the local 7.6.8, the same problem occurred, preventing me from using it. Then, I installed the latest version 7.6.9 using the command "winget install --id Microsoft.PowerShell --source winget" and it worked properly. I won't change the configuration you mentioned for now and will observe one version to see if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions