I'm writing a script to keep track of a NetApp volume move job. For each volume, I'm writing stuff to the screen like:
Once the move has complete, the next displayed line is something like:
It repeats like that for each volume.
What I'd like to do is have a line after the "Starting move..." line that says "Progress:" followed by a continuously updating progress percentage.
This is where I'm stumped. Sure, I can get the percentage and write it to the screen periodically, but then I'll end up with something ugly, like this:
What I want is just one "Progress:" line that I can overwrite with the current percentage.
So basically, the general question is: is it possible to do a "Write-Host" (or some other command) that overwrites the same line on the screen?
EDIT: This in the PowerShell ISE, specifically, btw.
Code:
5/10/2019 9:15:36 AM - Volume: vol_backups
5/10/2019 9:15:36 AM - Starting move...
Code:
5/10/2019 11:01:20 AM - Move complete in 6419 sec.
What I'd like to do is have a line after the "Starting move..." line that says "Progress:" followed by a continuously updating progress percentage.
This is where I'm stumped. Sure, I can get the percentage and write it to the screen periodically, but then I'll end up with something ugly, like this:
Code:
5/10/2019 9:15:36 AM - Volume: vol_backups
5/10/2019 9:15:36 AM - Starting move...
Progress: 1%
Progress: 9%
Progress: 17%
Progress: 28%
Progress: 36%
[etc.]
So basically, the general question is: is it possible to do a "Write-Host" (or some other command) that overwrites the same line on the screen?
EDIT: This in the PowerShell ISE, specifically, btw.