Start-VM cmdlet in PowerShell starts a virtual machine. Start-VM is used to start one or more virtual machines on Hyper-V hosts. It’s available in the Hyper-V module.
In this blog post, we will discuss how to use the Start-VM cmdlet in PowerShell to start virtual machines on one or more Hyper-V hosts.
Start-VM Syntax
Start-VM starts a virtual machine.
Syntax:
Start-VM [-CimSession <CimSession[]>] [-ComputerName <String[]>] [-Credential <PSCredential[]>] [-Name] <String[]> [-AsJob] [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>] Start-VM [-VM] <VirtualMachine[]> [-AsJob] [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
Parameters:
ComputerName: Specifies one or more Hyper-V hosts on which virtual machine is to be started. Default is the local computer.
Name: Specifies the name of the virtual machine to be started.
VM: Specified the name of the virtual machine.
AsJob: Runs the cmdlet as a background job.
CimSession: Run the cmdlet on a remote computer or remote session. Default is the current session of the local computer.
Credentials: Specifies the user accounts who has permission to perform the task. Default is the current user.
Start-VM to Start Virtual Machine
Use Start-VM cmdlet in PowerShell to start the virtual machine as given below
Start-VM -Name VM-1
In the above PowerShell script,
Start-VM command starts virtual machine VM-1 specified by the Name parameter.
The output of the above command is given below
Cool Tip: How to create a resource pool for measuring memory usage of the virtual machine!
Start Multiple Virtual Machines
You can use the Start-VM cmdlet to starts one or more virtual machines on Hyper-V hosts as given below
Start-VM -Name VM*
In the above PowerShell script,
Start-VM starts all virtual machines whose names start with VM.
Cool Tip: How to use test-connection to ping a list of computers!
Conclusion
In the above article, we discussed how to use the Start-VM cmdlet in the PowerShell Hyper-V module to starts one or more virtual machines.
Alternatively, you can also use Hyper-V manager to starts the virtual machine manually.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.