Guest User

Untitled

a guest
Aug 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. watch cat my-output.txt
  2.  
  3. watch grep "fail" my-output.txt
  4.  
  5. @ECHO OFF
  6. :loop
  7. %*
  8. timeout /t 5
  9. goto loop
  10.  
  11. watch echo test
  12.  
  13. C:Users[username]DocumentsWindowsPowerShellModulesWatch
  14.  
  15. # ---- BEGIN SCRIPT
  16. # Author: John Rizzo
  17. # Created: 06/12/2014
  18. # Last Updated: 06/12/2014
  19. # Website: http://www.johnrizzo.net
  20.  
  21. function Watch {
  22. [CmdletBinding(SupportsShouldProcess=$True,ConfirmImpact='High')]
  23. param (
  24. [Parameter(Mandatory=$False,
  25. ValueFromPipeline=$True,
  26. ValueFromPipelineByPropertyName=$True)]
  27. [int]$interval = 10,
  28.  
  29. [Parameter(Mandatory=$True,
  30. ValueFromPipeline=$True,
  31. ValueFromPipelineByPropertyName=$True)]
  32. [string]$command
  33. )
  34. process {
  35. $cmd = [scriptblock]::Create($command);
  36. While($True) {
  37. cls;
  38. Write-Host "Command: " $command;
  39. $cmd.Invoke();
  40. sleep $interval;
  41. }
  42. }
  43. }
  44.  
  45. Export-ModuleMember -function Watch
  46.  
  47. # --- END SCRIPT
  48.  
  49. while(1){ netstat -an|grep 1920;start-sleep -seconds 2;clear }
  50.  
  51. @echo off
  52. :loop
  53. cls
  54. dir c:temp
  55. REM 5000mS (5 sec) delay...
  56. ping 1.1.1.1 -n 1 -w 5000 >NUL
  57. goto loop
  58.  
  59. for /l %g in () do @( echo test & timeout /t 2 )
  60.  
  61. @ECHO OFF
  62. :loop
  63. %*
  64. sleep 5
  65. goto loop
Add Comment
Please, Sign In to add comment