So I was using Power Shell in Windows 10 and realised my command history was being saved across sessions. Clear-History did nothing for me. I found out that I could do either one of these two things (at least)
Run the following command, [Microsoft.PowerShell.PSConsoleReadLine]::ClearHistory()
But the above only clears it for that session and commands come back next session (via the up arrow) Or find the ConsoleHost_history file and clear it
That permanently deletes the commands across sessions. Also, it occurred to me that I should indicate what version of PowerShell I am working with. The command I used was $PSVersionTable.PSVersion and the result
Major Minor Build Revision ----- ----- ----- -------- 5 1 14986 1000
Sharing on the blog because it was not so easy to find this information. Hope this helped you if you came searching and found this.