New-GUID

Create a GUID (Globally Unique Identifier).

Syntax
      New-GUID [CommonParameters]

Use this to generate a new random globally unique identifier.

RFC 4122, which defines the UUID specification, stipulates that output hex characters should be in lowercase when converting the structure to a string.

The international ITU spec X.667 states: It is recommended that the hexadecimal representation used in all human-readable formats be restricted to lower-case letters. Software processing this representation is, however, required to accept both upper and lower case letters.

Examples

Create a GUID:

PS C:\> New-GUID

Alternatives using a .net method:

PS C:\> "{" + [guid]::NewGUID().ToString() + "}"

PS C:\> "{" + [guid]::NewGUID().ToString().ToUpper() + "}"

“Feeling unique is no indication of uniqueness” ~ Douglas Coupland

Related PowerShell Cmdlets

New-Item - Create a new item in a namespace.
Write-Output - Echo an object to the pipeline.


 
Copyright © 1999-2024 SS64.com
Some rights reserved