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:
- Clear-History
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 [email protected].
NOT TRUE, wont’ clear at all.
Maybe this helps:
https://stackoverflow.com/questions/13257775/powershell-clear-history-doesnt-clear-history#13257933
To clear a normal windows console, use
doskey /listsize=0
Hope that helps 😉