File tree Expand file tree Collapse file tree
src/Microsoft.PowerShell.Commands.Utility/commands/utility
test/powershell/Modules/Microsoft.PowerShell.Utility Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ protected override void ProcessRecord()
4949 }
5050 else
5151 {
52- guid = Empty . ToBool ( ) ? Guid . Empty : Guid . NewGuid ( ) ;
52+ guid = Empty . ToBool ( ) ? Guid . Empty : Guid . CreateVersion7 ( ) ;
5353 }
5454
5555 WriteObject ( guid ) ;
Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ Describe "New-Guid" -Tags "CI" {
4343 $observed | Should - Be $guids
4444 }
4545
46+ It " Should generate a UUID v7" {
47+ $guid = New-Guid
48+ # UUID v7 has version nibble '7' at position 14 in the string representation
49+ $guid.ToString ()[14 ] | Should - BeExactly ' 7'
50+ }
51+
4652 It " Should return different guids with each call" {
4753 $guid1 = New-Guid
4854 $guid2 = New-Guid
You can’t perform that action at this time.
0 commit comments