I like to get my code 'working' and then see if I can shorten the code, make it run faster, or maybe just reduce the number of variables I'm using.
However, sometimes I end up breaking things. At which point, I want to jump back to a version of the code that executed successfully. To do that, I sometimes use the code block below:
Get-History |
SELECT * |
Out-GridView -PassThru |
foreach { $_.CommandLine } | clip