Export recently typed Power Shell/Command line commands to text file

What commands, methods, or utilities are available that will allow me to export all recently typed Power Shell or Command line commands to a text file?

I often need to go back and look at all recently typed in Power Shell or command line commands and being able to export these commands into a text file instead of having to press the up cursor key to scroll through the recently typed in commands will be quite helpful.

If there aren't any ways of doing this using native Windows commands or functionality then what third party utilities or software will allow this to be done?
IT GuyNetwork EngineerAsked:
Who is Participating?
 
Seth SimmonsSr. Systems AdministratorCommented:
powershell
get-history > file.txt

command prompt
doskey > file.txt
2
 
NVITCommented:
@Seth

correction:
doskey /history > file.txt
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.