PowerShell Logo Small

Clear-Host



This is the built-in help made by Microsoft for the command 'Clear-Host', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Clears the display in the host program.

SYNTAX


Clear-Host [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Clear-Host function removes all text from the current display, including commands and output that might have accumulated. When complete, it displays the command p
rompt. You can use the function name or its alias, CLS.

Clear-Host affects only the current display. It does not delete saved results or remove any items from the session. Session-specific items, such as variables and func
tions, are not affected by this function.

Because the behavior of the Clear-Host function is determined by the host program, Clear-Host might work differently in different host programs.



<

RELATED LINKS

Online version: http://technet.microsoft.com/library/hh852689(v=wps.630).aspx
Get-Host
Out-Host
Read-Host.
Write-Host



REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>cls

# Before

PS C:\>Get-Process

Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
843 33 14428 22556 99 17.41 1688 CcmExec
44 6 2196 4964 52 0.23 692 conhost
646 12 2332 4896 49 1.12 388 csrss
189 11 2860 7084 114 0.66 2896 csrss
78 11 1876 4008 42 0.22 4000 csrss
76 7 1848 5064 54 0.08 1028 dwm
610 41 23952 44048 208 4.40 2080 explorer
0 0 0 24 0 0 Idle
182 32 7692 15980 91 0.23 3056 LogonUI
186 25 7832 16068 91 0.27 3996 LogonUI
1272 32 11512 20432 58 25.07 548 lsass
267 10 3536 6736 34 0.80 556 lsm
137 17 3520 7472 61 0.05 1220 msdtc
447 31 70316 84476 201 1,429.67 836 MsMpEng
265 18 7136 15628 134 2.20 3544 msseces
248 16 6476 4076 76 0.22 1592 NisSrv
368 25 61312 65508 614 1.78 848 powershell
101 8 2304 6624 70 0.64 3648 rdpclip
258 15 6804 12156 50 2.65 536 services
...

PS C:\> cls
#After

PS C:>



Description

-----------

This command uses the CLS alias of Clear-Host to clear the current display.