Just type the following line in PowerShell command prompt:
If you need GUID wrapped in curly braces modify the script line to:[System.Guid]::NewGuid().toString()
"{"+[System.Guid]::NewGuid().toString()+"}"
$guid="{"+[System.Guid]::NewGuid().toString()+"}"So once you run the last script you have a new GUID in the clipboard. As for me - that what I call convenient
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$dataObject = New-Object windows.forms.dataobject
$dataObject.SetData([Windows.Forms.DataFormats]::UnicodeText, $true, $guid)
[Windows.Forms.Clipboard]::SetDataObject($dataObject, $true)
write-host The following GUID has been copied to the clipboard: $guid
No comments:
Post a Comment