Recently I had to run a command that unfortunately required me to type a password right on the command line.
Afterwards, I cleared my screen with \"Clear\", but also
To clear the on screen display history (F7) you have to press Alt + F7.
This history is managed by the console buffer, not by PowerShell that has its history clearable by the Clear-History
cmdlet.
To script it, try:
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.SendKeys]::Sendwait('%{F7 2}')