You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] PowerShell 7.6.6 crashes on startup in zh-CN with ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value #28302
Install PowerShell 7.6.6 on a Windows system with zh-CN (Simplified Chinese) locale.
Open Windows Terminal or conhost.
Run pwsh.exe.
PowerShell crashes immediately.
Expected behavior
PowerShell 7.6.6 should start normally and display an interactive prompt (e.g., `PS C:\>`), allowing me to execute commands without crashing.
Actual behavior
PowerShell terminates immediately on startup before showing any prompt. The process crashes with an `ArgumentOutOfRangeException` because `String.PadRight` is called with a negative width of -17 during the update notification display. The terminal closes instantly, making it impossible to execute any commands like `2 + 2`.
Error details
The process fails fast during initialization. Here is the full console output:PowerShell 7.6.6Process 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, Microsoft.Win32.SafeHandles.ObjectHandleOnStack, System.String) at System.Environment.FailFast(System.Threading.StackCrawlMark ByRef, System.String, System.Exception, String) at System.Environment.FailFast(String, Exception) at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[], Int32) at Microsoft.PowerShell.ManagedPSEntry.Main(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
Note: $PSVersionTable cannot be run in PowerShell 7.6.6 because pwsh crashes immediately on startup before reaching an interactive prompt.
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.
jmeng111 (@jmeng111) - as noted above this has already been fixed as of 7.6.8 - please update to the latest supported version of PowerShell which is currently 7.6.9
Activity
rhubarb-geek-nz commentedon Nov 3, 2026
I think this is a duplicate of #28298 and #28131.
kilasuit commentedon Nov 3, 2026
jmeng111 (@jmeng111) - as noted above this has already been fixed as of 7.6.8 - please update to the latest supported version of PowerShell which is currently 7.6.9