◐ Shell
clean mode source ↗

Change New-Guid to generate UUID v7 by default by SufficientDaikon · Pull Request #27033 · PowerShell/PowerShell

@SufficientDaikon mentioned this pull request

Mar 15, 2026
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 <noreply@anthropic.com>

This was referenced

Mar 24, 2026

SufficientDaikon added a commit to SufficientDaikon/PowerShell-Docs that referenced this pull request

Mar 25, 2026
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

@kilasuit kilasuit added CL-General

Indicates that a PR should be marked as a general cmdlet change in the Change Log

Review - Maintainer

The PR/issue needs a review from the PowerShell repo Maintainers

labels

Apr 7, 2026

@SufficientDaikon

Copilot AI review requested due to automatic review settings

May 10, 2026 23:31

@SufficientDaikon

@SufficientDaikon