Clear screen when doing a continuous performance counter

I am trying to get continuous disk IOPS on a server, but trying to forego the results from continuing to scroll down the screen. Instead, I’d like to clear the screen between samples to gather, and if possible do the same in an out-gridview view as well.

$c="\PHysicalDisk(*)\Disk Reads/sec"
get-counter -counter $c -computername server1 -continuous -sampleinterval 5

you could use this endless loop that was provided here:

Then make a script similar to this:

$c="\PHysicalDisk(*)\Disk Reads/sec"
$displaycount = 20
        $counter = get-counter -counter $c -sampleinterval 5
        if($i -eq $displaycount)
            $i = 0
        write-output $counter
  $sapi = New-Object -ComObject Sapi.SpVoice
  $sapi.Speak('Hey, you aborted me dammit!')

This will not work with Out-Gridview, but you could “refresh” you console window with this

$ComputerName = 'server1'
$Counter = '\PHysicalDisk(*)\Disk Reads/sec' 
$SampleInterval = 5

Get-Counter -Counter $Counter -ComputerName $ComputerName -SampleInterval $SampleInterval -Continuous | ForEach-Object {

There is no inherent way within that cmdet.

while ($true) { cls; get-counter -counter $c -computername util1; sleep 5 }

EDIT: Oops. Essentially the same as above. He was just quicker.

Thanks all for your quick responses. I love this community and how much we are all willing to help each other out. I’ve tried Christian’s solution and it looks like it will work for me.