Yesterday I was working with two IT professionals who had probably over 25 years of combined experience working with Windows, but neither of them was aware of this useful technique.
It’s possible to copy the contents of a standard Windows message box into the clipboard. This is especially useful for those cases where a full exception and stack trace is included in the message.
Pressing CTRL+C will place the following text in the Windows clipboard:
In case you’re wondering how I generated that message box, it took two lines of PowerShell:
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show("Message Box Text","Message Box Title",[Windows.Forms.MessageBoxButtons]::RetryCancel,[Windows.Forms.MessageBoxIcon]::Error)