Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dummyshell = New-Object -com "Wscript.shell" #new shell
- $rn = 0; #rn for repeated number of time.
- while(1) #while(true)
- {
- $dummyshell.sendkeys("{F13}") #sends F13 to Shell window
- $rn++ #increments Repeat number by 1
- Function Sleep-Progress($seconds) {
- $s = 0; #Used to subtract from $seconds to see how many seconds are left and to figure out rough progress
- Do {
- $p = [math]::Round(100 - (($seconds - $s) / $seconds * 100)); #make progress roughly out 100%
- Write-Progress -Activity "Until next scan..." -Status "$p% Complete:" -SecondsRemaining ($seconds - $s) -PercentComplete $p; #the progress bar
- $sr = $seconds - $s #Second Remaining until repeat
- $Title = "$sr - $rn" #Change the title to show Seconds remaining and number of repeats
- $host.UI.RawUI.WindowTitle = $Title
- [System.Threading.Thread]::Sleep(1000) #sleep for 1 second
- $s++; #add one $s
- }
- While($s -lt $seconds); #do the above while $s is less than $seconds
- }
- Sleep-Progress 30 #Change this number to how many seconds you want before it repeats
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement