Display: Cloud | List
Most Popular Tags
Results (5 total) All > powershell (x) > system.guid (x)
Sample using PowerShell (Guid.ToString Method (String) (System))
<#.SYNOPSIS This script Creates then displays a GUID by using .TOString().DESCRIPTION This script demonstrates the 4 format specifiers you can send to .TOString() to affect the display. Note when you run this script, you will get a different GUID to the one shown in the example.NOTES File Name : Format-GUID.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShe
Last modified by Thomas Lee on 12/20/2009 12:58:40 PM
Empty Guid Field with PowerShell (Guid.Empty Field (System))
# Get-Empty Guid.ps1# Gets an empty guid# Thomas lee - tfl@psp.co.uk# create an empty guid$g = [system.guid]::empty# Display the empty guid"The empty guid: {0}" -f $g This script produces the following output:PS C:\foo> .\Get-EmptyGuid.ps1The empty guid: 00000000-0000-0000-0000-000000000000
Last modified by Thomas Lee on 7/19/2008 1:05:36 PM
NewGuid using PowerShell (Guid.NewGuid Method (System))
# Get-Guid.ps1# Get's a GUID# thomas lee - tfl@psp.co.uk# create new GUID$g = [system.guid]::newguid()# Display the byte array"The new guid: {0}" -f $g This script produces the following output: PS C:\foo> .\Get-Guid.ps1The new guid: 9db1bda7-40bd-4d05-ad19-7981a035954b
Last modified by Thomas Lee on 7/19/2008 1:00:05 PM
Converting GUID to a Byte Array using PowerShell (Guid.ToByteArray Method (System))
# Get-GuidByteString.ps1# sample for MSDN# thomas lee - tfl@psp.co.uk # create new GUID$g = [system.guid]::newguid()# now get guid into byte array$b=$g.tobytearray()# finally display the byte array"the guid: {0} converted to byte array is:" -f $g$b This script returns the following output: PS C:\Users\tfl> C:\foo\Get-GuidByteString.ps1the guid: b6749c8e-a366-4d7f-b65a-798224d5b6
Last modified by Thomas Lee on 7/4/2008 2:36:45 PM
NewGuid method using PowerShell (Guid.NewGuid Method (System))
# new-guid.ps1# creates a new GUID# thomas lee - tfl@psp.co.uk# Create a new guid and display it$guid = [system.guid]::newguid()$guidThis script produces the following output:PSH [D:\foo]: D:\foo\new-guid.ps1Guid ---- a55954b3-f858-4f83-82a9-38422b10168d
Last modified by Thomas Lee on 5/3/2008 11:00:49 PM
Page view tracker