GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — Change New-Guid to generate UUID v7 by default by SufficientDaikon · Pull Request #27033 · PowerShell/PowerShell Conversation
|
| File | Change |
|---|---|
NewGuidCommand.cs |
Guid.NewGuid() → Guid.CreateVersion7() |
New-Guid.Tests.ps1 |
Added version-nibble test: position 14 == 7 |
- guid = Empty.ToBool() ? Guid.Empty : Guid.NewGuid(); + guid = Empty.ToBool() ? Guid.Empty : Guid.CreateVersion7();
(New-Guid).ToString()[14] returns 7The Cmdlets Working Group approved this change in #24895 ΓÇö specifically @SteveL-MSFT's decision to change the default with no new switches. Guid.CreateVersion7() has been available since .NET 9; PowerShell targets .NET 11.
A previous attempt (#26256) was opened by Copilot but went stale.
.h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Replace `Guid.NewGuid()` with `Guid.CreateVersion7()` in the New-Guid cmdlet. UUID v7 (RFC 9562) embeds a millisecond-precision timestamp making generated GUIDs monotonically sortable, which is ideal for database primary keys and distributed systems. Users who specifically need UUID v4 can call [Guid]::NewGuid() directly. Fixes PowerShell#24895 Co-Authored-By: Claude Opus 4.6 <[email protected]>
015e5c4 to
bb0794b
Compare
Update `New-Guid` reference page for PowerShell 7.6 to reflect the change from UUID v4 to UUID v7 (`Guid.CreateVersion7()`). Add .NET API examples per docs team request, and note the breaking change in the What's New page. Closes MicrosoftDocs#12884 Related: PowerShell/PowerShell#27033
|
What is holding this up? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thomas Lee (@doctordns) idk, do i need to do anything on my end? is there some sort of the check the code isn't passing? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Updates the New-Guid cmdlet to generate RFC 9562 UUID v7 values by default (time-ordered GUIDs via Guid.CreateVersion7()), aligning the cmdlet’s default behavior with newer UUID guidance while preserving the existing cmdlet surface area.
Changes:
New-Guid default generation from Guid.NewGuid() (v4) to Guid.CreateVersion7() (v7) when not using -Empty or -InputObject.7 in the default string representation.Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs |
Changes the cmdlet’s default GUID creation to UUID v7 via Guid.CreateVersion7(). |
test/powershell/Modules/Microsoft.PowerShell.Utility/New-Guid.Tests.ps1 |
Adds a test to confirm New-Guid produces UUID v7 by checking the version nibble in the string form. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
why does copilot keep triggering without being told to? You guys are wasting so much compute with this xD is this why new copilot subs are closed? all the copilot compute is going towards random pull requests xD anyway, anything needed on my end? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) can we get this progressed please |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6f7ffc2
into
PowerShell:master
There was an error while loading. Please reload this page.
Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Justin Chung <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add UUID v7 support toNew-Guid
There was an error while loading. Please reload this page.