Hyper-V start time delay

Welcome Forums General PowerShell Q&A Hyper-V start time delay

Viewing 3 reply threads
  • Author
    Posts
    • #266324
      Participant
      Topics: 2
      Replies: 3
      Points: 9
      Rank: Member

      hi,

      is it possible to change the hyper-v start time delay over powershell script?
      I’m not really good in powershell, here’s my script:

      $selectvm = get-vm | where {$_.Name -match “AP”} | Start-VM
      $selectvm

      how can I add here a delay, or can I change the value in the configuration over powershell ?

      thanks 🙂

    • #266360
      Senior Moderator
      Topics: 10
      Replies: 196
      Points: 1,051
      Helping Hand
      Rank: Community Hero

      Not sure about changing the configuration with PowerShell, but you can simply use Start-Sleep to add a delay:

      Change $delay_time as necessary. Also, with the -ComputerName parameter you can use Start-VM from a normal workstation to start a VM on a remote system (such as a HyperV server).

    • #271126
      Participant
      Topics: 2
      Replies: 3
      Points: 9
      Rank: Member

      thanks for your script, works “where” for all VMs with the $filter_text

      means when I have 3 VMs?

      and delay-time is in minutes or seconds?

       

      thanks

    • #271153
      Participant
      Topics: 17
      Replies: 1869
      Points: 3,631
      Helping Hand
      Rank: Community Hero

      Where the name of the VM is “AP” The sleep question is pretty easy to answer if you look at the code…

      Start-Sleep -Seconds $delay_time

Viewing 3 reply threads
  • You must be logged in to reply to this topic.