Last active
November 4, 2016 11:19
-
-
Save Kieranties/5a2b90c0091592dda981699244fa1e79 to your computer and use it in GitHub Desktop.
Get a new guid on your clipboard quickly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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