René's URL Explorer Experiment


Title: Sort-Object returns different results on default OS configs for Windows vs. Ubuntu 18.04 · Issue #8824 · PowerShell/PowerShell · GitHub

Open Graph Title: Sort-Object returns different results on default OS configs for Windows vs. Ubuntu 18.04 · Issue #8824 · PowerShell/PowerShell

X Title: Sort-Object returns different results on default OS configs for Windows vs. Ubuntu 18.04 · Issue #8824 · PowerShell/PowerShell

Description: When I use sort-object on PowerShell Core on Windows vs. Ubuntu 18.04, the results are sorted differently using the operating systems out of the box. IMO, the Windows behavior is correct, if for no other reason that it is consistent with...

Open Graph Description: When I use sort-object on PowerShell Core on Windows vs. Ubuntu 18.04, the results are sorted differently using the operating systems out of the box. IMO, the Windows behavior is correct, if for no...

X Description: When I use sort-object on PowerShell Core on Windows vs. Ubuntu 18.04, the results are sorted differently using the operating systems out of the box. IMO, the Windows behavior is correct, if for no...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/8824

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sort-Object returns different results on default OS configs for Windows vs. Ubuntu 18.04","articleBody":"When I use sort-object on PowerShell Core on Windows vs. Ubuntu 18.04, the results are sorted differently using the operating systems out of the box. IMO, the Windows behavior is correct, if for no other reason that it is consistent with PowerShell Desktop. In general, if a language such as Javascript were to suddenly release a change that made sorting primitives native to the language behave differently on Windows vs. Linux / Mac, the web as we know it would break completely.\r\n\r\n# Steps to reproduce\r\nRun the following command on PowerShell Core 6.2.0 preview3 on Windows, and on Ubuntu 18.04:\r\n\r\n```powershell\r\n$PSVersionTable.Platform;('a', 'ab', 'aC' | Sort-Object ) -join ','\r\n```\r\n\r\n# Expected behavior\r\nThe only difference should be the Platform string, Windows vs. Linux, that is output -- the sorted object output should be the same on both platforms, like this:\r\n\r\n```powershell\r\n# The first line below is executed on Windows, the second on Ubuntu 18.04\r\nPS> $PSVersionTable.Platform;('a', 'ab', 'aC' | Sort-Object ) -join ','\r\nWin32NT\r\na,ab,aC\r\nPS> $PSVersionTable.Platform;('a', 'ab', 'aC' | Sort-Object ) -join ','\r\nUnix\r\na,ab,aC\r\n```\r\n# Actual behavior\r\nNot only are the platforms different, but Windows returns the objects in a different (correct IMO) order than on Linux!\r\n\r\n```powershell\r\n# The first line below is executed on Windows, the second on Ubuntu 18.04\r\nPS> $PSVersionTable.Platform;('a', 'ab', 'aC' | Sort-Object ) -join ','\r\nWin32NT\r\na,ab,aC\r\nPS> $PSVersionTable.Platform;('a', 'ab', 'aC' | Sort-Object ) -join ','\r\nUnix\r\na,aC,ab\r\n```\r\n# Impact\r\nThis is pretty serious -- by default, scripts running on Windows and Linux will return different results for something as canonical as sorting text strings. This breaks modules in some obvious ways for me at the moment (in my case, parameter completion is broken as it relies on sorting), but it also means there are subtle changes to fundamental assumptions of scripts that may result in seemingly non-deterministic behavior that is difficult to reproduce and apparently random. Diagnosing the root cause may also be difficult as few people would expect a built-in function like `sort-object` to exhibit this behavior.\r\n\r\nCertainly the precedent set by other dynamic languages such as Javascript, Python, or Ruby is that the behavior is consistent when using built-in language primitives to sort.\r\n\r\n# Notes\r\nPer [this comment on issue 8604](https://github.com/PowerShell/PowerShell/issues/8064#issuecomment-460127076), I tried the suggestion that configuring the LC_ALL variable on Linux would affect this, and it turns out that this is indeed the case, as demonstrated by running the following commands on `bash` on Linux:\r\n\r\n```sh\r\n# Works fine\r\nLC_ALL=en_US.UTF-8 pwsh-preview -noprofile -c \"echo \\$PSVer\r\nsionTable.PSVersion;('a', 'ab', 'aC' | Sort-Object ) -join ','\"\r\n\r\nMajor  Minor  Patch  PreReleaseLabel BuildLabel\r\n-----  -----  -----  --------------- ----------\r\n6      2      0      preview.3\r\na,ab,aC\r\n\r\n# Broken!\r\nLC_ALL=C pwsh-preview -noprofile -c \"echo \\$PSVersionTable.PSVersion;('a', 'ab', 'aC' | Sort-Object ) -join ','\"\r\n\r\nMajor  Minor  Patch  PreReleaseLabel BuildLabel\r\n-----  -----  -----  --------------- ----------\r\n6      2      0      preview.3\r\na,aC,ab\r\n```\r\n# Environment data\r\nPSVersionTable Output:\r\n\r\n```powershell\r\nPS /mnt/c/Users/adamed/src/sdk/autographps-sdk> $PSVersionTable\r\n\r\nName                           Value\r\n----                           -----\r\nPSVersion                      6.2.0-preview.3\r\nPSEdition                      Core\r\nGitCommitId                    6.2.0-preview.3\r\nOS                             Linux 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018\r\nPlatform                       Unix\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```\r\nIn general I would agree with [the comment on issue 8604](https://github.com/PowerShell/PowerShell/issues/8064#issuecomment-460127076) that the unix `sort` command doesn't exhibit this behavior even with `LC=C`. I would think that if the issue comes from .net core, it should be fixed there (what does `mono` do?), but if not, it seems like a fix is needed on PowerShell Core -- this is a huge portability problem and also goes against what JavaScript, Python, and Ruby have set as a standard.","author":{"url":"https://github.com/adamedx","@type":"Person","name":"adamedx"},"datePublished":"2019-02-04T15:15:02Z","url":"https://github.com/PowerShell/PowerShell/issues/8824"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:44816fd0-8dee-6779-fd27-28dd95d239ee
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD11C:391229:17F882:20B83B:6AFD4E6D
html-safe-nonce5c12d9a72ae6f8effef46b3f50b3149ca0c870e9bec1f8914255403023b68185
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTFDOjM5MTIyOToxN0Y4ODI6MjBCODNCOjZBRkQ0RTZEIiwidmlzaXRvcl9pZCI6IjE5NTMwMzM0NDY0NjQ3Njk2NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb5e42623b5b080bfb05a351eba14757e48439747aaa8757a89d1b12fb1c32613
hovercard-subject-tagissue:406375434
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/8824/issue_layout
twitter:imagehttps://opengraph.githubassets.com/644f9ebdd74ca3c95dd3971354d9227fbe2053251641ecec6dc0c305941c66d8/PowerShell/PowerShell/issues/8824
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/644f9ebdd74ca3c95dd3971354d9227fbe2053251641ecec6dc0c305941c66d8/PowerShell/PowerShell/issues/8824
og:image:altWhen I use sort-object on PowerShell Core on Windows vs. Ubuntu 18.04, the results are sorted differently using the operating systems out of the box. IMO, the Windows behavior is correct, if for no...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameadamedx
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/8824#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F8824
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F8824
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/8824
Reloadhttps://github.com/PowerShell/PowerShell/issues/8824
Reloadhttps://github.com/PowerShell/PowerShell/issues/8824
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/8824
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/8824
Sort-Object returns different results on default OS configs for Windows vs. Ubuntu 18.04https://github.com/PowerShell/PowerShell/issues/8824#top
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
https://github.com/adamedx
Adam Edwards (adamedx)https://github.com/adamedx
on Feb 4, 2019https://github.com/PowerShell/PowerShell/issues/8824#issue-406375434
this comment on issue 8604https://github.com/PowerShell/PowerShell/issues/8064#issuecomment-460127076
the comment on issue 8604https://github.com/PowerShell/PowerShell/issues/8064#issuecomment-460127076
Adam Edwards (adamedx)https://github.com/adamedx
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
on Feb 4, 2019https://github.com/PowerShell/PowerShell/issues/8824#event-2115944514
Brandon Olin (devblackops)https://github.com/devblackops
on Sep 13, 2019https://github.com/PowerShell/PowerShell/issues/8824#event-2631236001
Fix sorting issue on *nix and PSCorehttps://github.com/devblackops/psake/commit/247e8c886223345cccc95231133ab47108d4bccb
247e8c8https://github.com/devblackops/psake/commit/247e8c886223345cccc95231133ab47108d4bccb
Fix sorting issue on *nix and PSCorehttps://github.com/devblackops/psake/commit/db26d5935074425038066e03453e573ff0917495
db26d59https://github.com/devblackops/psake/commit/db26d5935074425038066e03453e573ff0917495
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Sep 29, 2019https://github.com/PowerShell/PowerShell/issues/8824#issuecomment-536278090
https://github.com/dotnet/corefx/issues/28611https://github.com/dotnet/corefx/issues/28611
Ilya (iSazonov)https://github.com/iSazonov
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 29, 2019https://github.com/PowerShell/PowerShell/issues/8824#event-2671100190
Ilya (iSazonov)https://github.com/iSazonov
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
on Sep 29, 2019https://github.com/PowerShell/PowerShell/issues/8824#event-2671100325
beatcrackerhttps://github.com/beatcracker
on Oct 24, 2021https://github.com/PowerShell/PowerShell/issues/8824#event-5509593425
Fix x-plat compatibilityhttps://github.com/beatcracker/toptout/commit/0353b6c59d441dc91e19d783533adf47d2cf37cb
0353b6chttps://github.com/beatcracker/toptout/commit/0353b6c59d441dc91e19d783533adf47d2cf37cb
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/8824
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/8824
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.