Clear-Host in VSCode

If you have been working with Visual Studio Code and the PowerShell extension for a while you probably
have seen that Clear-Host only will clear the visible Terminal window.

If you scroll up in the terminal window you will have all of the output left.

This can be fixed by a setting.

If you go to Settings and Search for “powershell force” you will get PowerShell > Integrated Console: Force Clear Scrollback Buffer.
Mark that one and go back to you Clear-Host and run it again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.