How to configure VM Auto Start in Hyper-V with PowerShell

VM automatic action at Hyper-V start up#

1
Set-VM [VM_NAME] -AutomaticStartAction [Option]

With :

  • [VM_NAME] : The VM name
  • [Option] :
    • Nothing : When the host is powered on, the VM will do nothing
    • StartIfRunning : The VM will start only if it was running when the host was stopped
    • Start : The VM will start up automatically not matter what state the VM was in previously

Change startup delay#

1
Set-VM [VM_NAME] -AutomaticStartDelay [Delay]

With :

  • [VM_NAME] : The VM name
  • [Delay] : Delay in second

Display VM Start action and delay#

All :

1
Get-VM -VMName * | Select-Object VMName,AutomaticStartAction,AutomaticStartDelay

One :

1
Get-VM -VMName [VM_NAME] | Select-Object VMName,AutomaticStartAction,AutomaticStartDelay

With :

  • [VM_NAME] : The VM name
Share