PowerShell Commands- Understanding Hyper- V

One of the things that Microsoft has stated is that the exams are going to be more PowerShell intensive. So, I wanted to add a PowerShell section showing the different PowerShell commands that you can use for Hyper- V. The information in Table 2.6 has been taken directly from Microsoft’s websites. The table explains just some of the PowerShell commands that you can use with Hyper- V.

Table 2.6 shows you just some of the PowerShell commands for  Hyper- V. To see a more comprehensive list, please visit Microsoft’s website at https://docs.microsoft.com/en- us/powershell/module/ hyper- v/?view=win10- ps.

                                                                          PowerShell Commands                  75
TABLE 2.6Hyper-V  PowerShell commands
CommandExplanation
Add- VMDvdDriveAdds a DVD drive to a virtual machine 
Add- VMHardDiskDriveAdds a hard disk drive to a virtual machine 
Add- VMMigrationNetworkAdds a network for virtual machine migration on one or more virtual machine hosts 
Add- VMNetworkAdapterAdds a virtual network adapter to a virtual machine 
Add- VMSwitchAdds a virtual switch to an Ethernet resource pool 
Checkpoint- VMCreates a checkpoint of a virtual machine 
Convert- VHDConverts the format, version type, and block size of a virtual hard disk file 
Copy- VMFileCopies a file to a virtual machine 
Debug- VMDebugs a virtual machine 
Disable- VMConsoleSupportDisables keyboard, video, and mouse for virtual machines 
Disable- VMMigrationDisables migration on one or more virtual machine hosts 
Dismount- VHDDismounts a virtual hard disk 
Enable- VMConsoleSupportEnables keyboard, video, and mouse for virtual machines 
Enable- VMMigrationEnables migration on one or more virtual machine hosts 
Enable- VMReplicationEnables replication of a virtual machine 
Enable- VMResourceMeteringCollects resource utilization data for a virtual machine or resource pool 
Export- VMExports a virtual machine to disk 
Export- VMSnapshotExports a virtual machine checkpoint to disk 

TABLE 2.6 Hyper-V  PowerShell commands (Continued)

Get- VHDGets the virtual hard disk object associated with a virtual hard disk
Get- VHDSetGets information about a VHD set
Get- VHDSnapshotGets information about a checkpoint in a VHD set
Get- VMGets the virtual machines from one or more Hyper-V  hosts
Get- VMDvdDriveGets the DVD drives attached to a virtual machine or snapshot
Get- VMHardDiskDriveGets the virtual hard disk drives attached to one or more virtual machines
Get- VMMemoryGets the memory of a virtual machine or snapshot.
Get- VMNetworkAdapterGets the virtual network adapters of a virtual machine, snapshot, management operating system, or of a virtual machine and management operating system
Get- VMProcessorGets the processor of a virtual machine or snapshot
Get- VMReplicationGets the replication settings for a virtual machine
Get- VMSwitchGets virtual switches from one or more virtual Hyper-V  hosts
Merge- VHDMerges virtual hard disks
Mount- VHDMounts one or more virtual hard disks
Move- VMMoves a virtual machine to a new Hyper-V  host
New- VHDCreates one or more new virtual hard disks
New- VMCreates a new virtual machine
New- VMGroupCreates a virtual machine group
New- VMSwitchCreates a new virtual switch on one or more virtual machine hosts

PowerShell Commands

TABLE 2.6 Hyper-V  PowerShell commands (Continued)

CommandExplanation
Set- VMSwitchConfigures a virtual switch
Stop- VMShuts down, turns off, or saves a virtual machine
Suspend- VMSuspends, or pauses, a virtual machine

Summary

Virtualization is quickly becoming a hot topic in information technology. The potential for consolidation is tremendous, and thus it will become more and more important.

After reading this chapter, you should have a good understanding of the Hyper- V architecture and what is required to install Hyper-V .

The section about installation and configuration covered various basic aspects of configuring the virtualization environment. You learned about the types of virtual networks that are available, the options for installing the Hyper- V role, and the types of virtual hard disks that you can use to optimize virtualization for your specific scenario.

You also learned how to configure virtual machines using the Hyper-V  environment and how to create your own virtual datacenter on top of your Hyper- V machines. I showed you how to create and manage virtual machines, how to use Virtual Machine Connection to control a virtual machine remotely, and how to install Hyper-V  Integration Components. You also learned how to export and import virtual machines as well as how to do snapshots of your virtual machine.

If you have never worked with virtualization software before, the information in this chapter may have been completely new to you. You should now be well prepared to try Hyper- V in your own environment.

Leave a Reply

Your email address will not be published. Required fields are marked *