Create a kind of Whirley in Powershell

Scripting for Windows PowerShell brings together resources for system administrators who are interested in learning about the Windows PowerShell command line and scripting environment.
User avatar
daniel
Site Admin
Posts: 223
Joined: Tue Jan 09, 2007 9:54 pm
Contact:

Create a kind of Whirley in Powershell

Postby daniel » Thu Feb 28, 2013 2:38 pm

Sometime when I launch a script, I've to be sure that the system is waiting before it continues with the rest of it.

This example give a time delay, which could be a nice to see:

Code: Select all

###===========================
### Pause Program for 10 min
### - Daniel Paessens
###===========================
$x = 10*60
$length = $x / 100
while($x -gt 0) {
  $min = [int](([string]($x/60)).split('.')[0])
  $text = " " + $min + " minutes " + ($x % 60) + " seconds left"
  Write-Progress "Pausing Script" -status $text -perc ($x/$length)
  start-sleep -s 1
  $x--
}



Originally found Here

Return to “PowerShell”

Who is online

Users browsing this forum: No registered users and 0 guests