Powershell Notes to Self

Inline text updating:
Lazy way of having a progress indicator that doesn’t fill the whole screen history and doesn’t require Write-Progress. Use NoNewline to avoid implicit newline/carriage return, then manually add a carriage return (`r) at the start of your line to overwrite existing text.

Write-Host "`r$TimestampOrWhatever: $ValueOrWhatever" -NoNewline

Leave a Reply

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