Skip to content

Instantly share code, notes, and snippets.

@Kieranties
Last active November 4, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kieranties/5a2b90c0091592dda981699244fa1e79 to your computer and use it in GitHub Desktop.
Save Kieranties/5a2b90c0091592dda981699244fa1e79 to your computer and use it in GitHub Desktop.
Get a new guid on your clipboard quickly
<#
.SYNOPSIS
Creates a guid of a specified format and writes to the clipboard
.EXAMPLE
PS> NewGuid
Write a new guid to your clipboard
e.g. 8a3c4316-5865-405d-94b7-5992446b12ce
PS> NewGuid B
PS> NewGuid N
Writes a new guid to your clipboard in the specified format
e.g. {91c2b5dd-344f-409e-a07b-5f9f2305ce8c}
e.g. 99147a13c6fc4b0e8e03704889755ad5
#>
function NewGuid {
param(
[string]$format
)
[guid]::NewGuid().ToString($format) | Set-Clipboard | Out-Null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment