How to find command history?

 By default Windows PowerShell keeps track of the most recent 64 commands typed in the console window; when you invoke the Get-History cmdlet only the 32 most recent of those commands are displayed (e.g., commands 33 through 64). So how do you view commands 1 through 32? In that case you tell Get-History to start with command 32 and count backwards (using the -count parameter) 32 times. Don’t worry; that sounds more complicated than it really is:

Get-History 32 -count 32

Incidentally, for any given Windows PowerShell session you can change the number of commands that Windows PowerShell keeps track of; that can be done by modifying the $MaximumHistoryCount variable. For example, would you prefer that Windows PowerShell keep track of your last 150 commands? Okey-doke:
$MaximumHistoryCount = 150


(Visited 1 times, 1 visits today)

By Arun Sabale

Arun is a Solution Architect on enterprise client management with more than 14 years of experience in IT. Arun Sabale is Blogger and tech enthusiast. His main focus is on Azure cloud infra, Cloud automation with powershell, python, ARM terraform and all cloud infra services like compute, storage, network, automation, function api etc... LinkedIN - https://www.linkedin.com/in/arun-sabale/