To get a list of commands you executed in a PowerShell Window session, we use “Get-History” PowerShell cmdlet. To clear the command history, you can use “Clear-History” as listed below:
To clear complete command history, type below command:
Each command, executed in the PowerShell Windows session, is assigned with an ID. To delete the commands with history IDs, use below command:
- Clear-History -ID 12, 20
About Nirmal Sharma
Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services. He is specialized in Directory Services, Microsoft Clustering, Hyper-V, SQL and Exchange and has been involved in Microsoft Technologies since 1994. In his spare time, he offers technical help by writing tips and articles. Nirmal can be reached at firstname.lastname@example.org.