Fancy Sleep

When you build in sleeps into your powershell script, this might be an option for a fancy Sleep option

function waitsec($sec) {
    for ($i=1;$i -le $sec;$I++) {Write-Host "■" -ForegroundColor Green -NoNewline;sleep 1};Write-host ""

Waitsec 4

This will show small squares ever 1 sec for the duration of in this case 4 seconds.

The user who is running the script will see some action instead of a still screen.


About the Author


I am a Technical Specialist - Cloud Infrastructures from the Netherlands. My Skills are mainly PowerShell, VMWare, Hyper-V, Microsoft System Center products and Windows Azure Pack. I work for a company in Utrecht The Netherlands.

No Comments

Comments are closed.