Title: [Bug] PowerShell 7.6.6 crashes on startup in zh-CN with ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value · Issue #28302 · PowerShell/PowerShell · GitHub
Open Graph Title: [Bug] PowerShell 7.6.6 crashes on startup in zh-CN with ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value · Issue #28302 · PowerShell/PowerShell
X Title: [Bug] PowerShell 7.6.6 crashes on startup in zh-CN with ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value · Issue #28302 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/28302
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug] PowerShell 7.6.6 crashes on startup in zh-CN with ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value","articleBody":"### Prerequisites\n\n- [x] Write a descriptive title.\n- [x] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [x] Search the existing issues.\n- [x] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [x] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\n1. Install PowerShell 7.6.6 on a Windows system with zh-CN (Simplified Chinese) locale.\n2. Open Windows Terminal or conhost.\n3. Run `pwsh.exe`.\n4. PowerShell crashes immediately.\n\n### Expected behavior\n\n```console\nPowerShell 7.6.6 should start normally and display an interactive prompt (e.g., `PS C:\\>`), allowing me to execute commands without crashing.\n```\n\n### Actual behavior\n\n```console\nPowerShell 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`.\n```\n\n### Error details\n\n```console\nThe process fails fast during initialization. Here is the full console output:\n\nPowerShell 7.6.6\nProcess terminated.\ntotalWidth ('-17') must be a non-negative value. (Parameter 'totalWidth')\nActual value was -17.\n at System.Environment.FailFast(System.Runtime.CompilerServices.StackCrawlMarkHandle, System.String, Microsoft.Win32.SafeHandles.ObjectHandleOnStack, System.String)\n at System.Environment.FailFast(System.Threading.StackCrawlMark ByRef, System.String, System.Exception, String)\n at System.Environment.FailFast(String, Exception)\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[], Int32)\n at Microsoft.PowerShell.ManagedPSEntry.Main(String[])\nSystem.ArgumentOutOfRangeException: totalWidth ('-17') must be a non-negative value. (Parameter 'totalWidth')\nActual value was -17.\n at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName)\n at System.String.PadRight(Int32 totalWidth, Char paddingChar)\n at Microsoft.PowerShell.UpdatesNotification.ShowUpdateNotification(PSHostUserInterface hostUI)\n at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, Boolean issProvidedExternally)\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)\n```\n\n### Environment data\n\n```powershell\nNote: $PSVersionTable cannot be run in PowerShell 7.6.6 because pwsh crashes immediately on startup before reaching an interactive prompt.\n```\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/jmeng111","@type":"Person","name":"jmeng111"},"datePublished":"2026-11-03T01:24:23Z","url":"https://github.com/PowerShell/PowerShell/issues/28302"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:86aed15a-5f57-915b-5eb1-c0e538440a48 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB06:158743:3FFF87:542B66:6AFCE8E0 |
| html-safe-nonce | c40a6b385db294e4ec7b2262047a9414ff8e80636160101dcef41752a2a9710d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjA2OjE1ODc0MzozRkZGODc6NTQyQjY2OjZBRkNFOEUwIiwidmlzaXRvcl9pZCI6Ijg1MzQ4OTU2OTU5OTgyODE5NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | deb6d7f1f4a3e3f358384e8339b3711a3486fff00c2abea5c3e8622057d7956a |
| hovercard-subject-tag | issue:6174300808 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/28302/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5aa2c6937f4491ea9a48c7774b8a19d80cbf494d850392adc9de820d3e86e485/PowerShell/PowerShell/issues/28302 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5aa2c6937f4491ea9a48c7774b8a19d80cbf494d850392adc9de820d3e86e485/PowerShell/PowerShell/issues/28302 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jmeng111 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ecfd63ca125ec74b42f74eeb158b3fa081c8c497 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width