1.    13 Jun 2008 #1
    JoeF Guest

    Waiting xx seconds before running next command

    I'm working on a script that we will use to power off a SAN in the event of a
    power failure. What I'd like to do is use have a computer called PC1 start a
    script on PC2 when it is being shutoff for power failure. I plan on having
    the UPS software initiate the script on PC1. When PC1 starts the script on
    PC2, I want PC2 to have a pause in the script where it waits for 5 minutes or
    so before running the next line that will start the shutdown on SAN.

    I'm not sure how get PowerShell to wait for xx seconds before running the
    next line. Any help would be greatly appreciated.

      My System SpecsSystem Spec

  2.    13 Jun 2008 #2
    Marco Shaw [MVP] Guest

    Re: Waiting xx seconds before running next command

    > I'm not sure how get PowerShell to wait for xx seconds before running the

    > next line. Any help would be greatly appreciated.
    The start-sleep cmdlet should help:

    PS > get-help start-sleep -examples
    Suspend shell, script, or runspace activity for the specified
    period of time.
    -------------------------- EXAMPLE 1 --------------------------
    C:\PS>Start-Sleep -s 15
    This command makes the shell sleep for 15 seconds.
    -------------------------- EXAMPLE 2 --------------------------
    C:\PS>Start-Sleep -m 500
    This command makes the command shell sleep for 1/2 second (500


    Microsoft MVP - Windows PowerShell

    PowerGadgets MVP

      My System SpecsSystem Spec

Similar Threads
Thread Forum
Pass argument for a command waiting for user input
Hi All, I am using perforce, in one scenario after execution of the command it keeps waiting for the user input on the command prompt. Once i...
Video stops running after about 30 seconds
I just recently did a complete restoration of my computer. Now when I try to play a video it runs for about 30 seconds and then stops dead, not sound...
General Discussion
Running get-command in SQLPS
Is that all your running is "get-command" and it errs? SQLPS is a minishell. Not everything that runs in regular PS will work while you're in...
Running a command from inside a script, command line is corrupted
Hello, I am trying to give Powershell a chance, since it seems like it may have some promise. I have this powershell script that needs to run...
Script not waiting for previous command to complete
One of the last commands in a Powershell script is: & 'C:\SomeExecutable.exe' a $backup '@C:\temp\backupfiles.txt' The variable $backup is...
10 seconds delay when starting 'command prompt'
When i start up cmd.exe the window pops up and freezes for 10 seconds. No CPU peak or hdd access. I have admin rights and uac is disabled. I...
Vista General
Running PS1 file from command line
Hi, I am trying to run a powershell script from the command line, and I would like this script to NOT show the box that powershell seem to show when...

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • PC Help Forum
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 18:13.