Generate a list of GUID's

Sometimes you just need a lot of GUID's while programming.  Ofcourse you could use the Visual Studio GUID tool, bu that is a lot of work.

Open a PowerShell console, and paste in the following line to get a list of 100 guid's:

$i=100; while ($i-- -gt 0) { Write-Host ([System.Guid]::NewGuid()) }

Published Thursday, May 31, 2007 1:07 AM by svdoever
Filed under: ,

Comments

Friday, June 01, 2007 7:01 AM by Jurjen

# re: Generate a list of GUID's

Or even faster, put this function in your profile:

#####

# generates a new Guid

function NewGuid

{

[System.Guid]::NewGuid().ToString()

}

All you have to type is:

[1] ? NewGuid

Friday, August 24, 2007 2:24 AM by lb

# re: Generate a list of GUID's

1..100 | % { Write-Host ([System.Guid]::NewGuid()) }

;-)

Monday, January 07, 2008 8:36 PM by David

# re: Generate a list of GUID's

Or, in case you need it to be handy later (and don't care for the function):

$gg = { [System.Guid]::NewGuid() }

1..100 | %{ Write-Host (&$gg) }

Then, later, you can also do:

$destination = "I want to go to the $(&$gg) Bar & Grill!"

(Thanks, Leon, for the 1..10 bit. That was new to me!)

Thursday, July 10, 2008 10:03 AM by Michael G

# re: Generate a list of GUID's

Awesome! You are a time saver!  Thanks

Wednesday, May 27, 2009 9:52 AM by The SharePoint Nomad

# The SharePoint Nomad

Pingback from  The SharePoint Nomad

Leave a Comment

(required) 
(required) 
(optional)
(required)