Monitor a Process in PowerShell

Sometimes you have a process, such as an Exchange Mailbox Export, which has a progress counter that you want to keep an eye on. This is a simple way to keep an eye on it so you don't have to constantly hit up, then enter to get an update.

while ($true) { 
    $stats = Get-MailboxExportRequest | Get-MailboxExportRequestStatistics | Sort PercentComplete -Descending; 
    Clear-Host; 
    $stats | Format-Table -Auto; 
    Start-Sleep -s 30; 
}

Explanation

while ($true)

This creates an infinite loop so you don't have to keep refreshing. Cancel with Ctrl+C.

$stats = Get-MailboxExportRequest | Get-MailboxExportRequestStatistics | Sort PercentComplete -Descending;

This gets a report of the current mailbox exports and stores it in a variable;

Clear-Host

This clears the screen so you can refresh the data.

$stats | Format-Table -Auto;

This displays the report.

Start-Sleep -s 30;

This waits 30 seconds before starting the next loop. Sometimes it's helpful so you don't refresh too fast, or if it's a long-running process, there'll be no reason to update that fast.