WMF 5.0 April 2015 preview – – creating guid

Creating a GUID has always been possible with PowerShell – you just had to drop into .NET

£> [System.Guid]::NewGuid()


With the latest WMF 5.0 preview life gets easier:

£> Get-Command New-Guid -Syntax

New-Guid [<CommonParameters>]

£> New-Guid


The New-Guid cmdlet happily creates a GUID for you – and you don’t have to remember the >NET syntax.

If you want the GUID in a variable as a string

£> $guid = New-Guid | select -ExpandProperty Guid
£> $guid

This entry was posted in PowerShell v5, WMFv5. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s