Copying Command Line History

by Jan 29, 2015

All PowerShell versions

To preserve all the PowerShell commands that you entered in a PowerShell session, check out this one liner:

(Get-History).CommandLine | clip.exe

It copies all commands to the clipboard. From there, you can paste them into PowerShell ISE and save them.

Twitter This Tip! ReTweet this Tip!