Cmdlet
Clear-ConsoleScreen
Clears the console screen, safely.
Syntax
Clear-ConsoleScreen [<CommonParameters>]#Parameter set:
All Parameter SetsDescription
Clears the console screen, safely.
On an interactive console the screen and its scrollback are cleared and the cursor goes to the top left, like Clear-Host. It does nothing where clearing would only lose output: redirected output, CI logs, plain mode (CONSOLEMONSTER_MODE=plain), background and thread jobs, and while a live dashboard owns the console. In the ISE and other hosts with a screen buffer it clears that buffer the way Clear-Host does.
Examples
EXAMPLE 1
Clear-ConsoleScreenCommon Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.