Powershell GUID Generator – DEV Community

I’ve constructed a easy GUID generator that generates GUID and places it into the clipboard!

You may obtain the file from my repository: guid.ps1

You may learn extra information on the Git Hub Page


In PowerShell you may generate GUIDby typing [Guid]::NewGuid() into your PS terminal, however you then would wish to repeat it from the terminal and paste it the place you want it. It was complicated for me so I’ve constructed a script that does all of the for you.

$guid = [guid]::NewGuid().ToString();

Set-Clipboard -Worth $guid;

Write-Host 'Guid:' $guid 'copied to the clipboard!';
Enter fullscreen mode

Exit fullscreen mode

In use

E:ps> guid
Guid: d5bae5bc-d0dc-47ef-bbf7-1323f7a2180e copied to the clipboard!
Enter fullscreen mode

Exit fullscreen mode

NOTE: Simply you’ll want to put the guid.ps1 file someplace the place your path is outlined so you may entry it from anyplace.

Add a Comment

Your email address will not be published. Required fields are marked *