Hyper-V Cmdlets in Windows PowerShell PDF
Hyper-V Cmdlets in Windows PowerShell PDF
PowerShell
This document is provided "as‐is". Information and views expressed in this document, including URL and other Internet Web site references, may change without notice.
This document does not provide you with any legal rights to any intellectual property in any Microsoft product or product name. You may copy and use this document
for your internal, reference purposes. You may modify this document for your internal, reference purposes.© 2015 Microsoft. All rights reserved. Terms of Use
﴾https://technet.microsoft.com/cc300389.aspx﴿ | Trademarks ﴾http://www.microsoft.com/library/toolbar/3.0/trademarks/en‐us.mspx﴿
Table Of Contents
Chapter 1
Hyper‐V Cmdlets
Chapter 1
Hyper‐V Cmdlets in Windows PowerShell
Windows Server 2012 R2 and Windows 8.1
Windows PowerShell® is a task‐based command‐line shell and scripting language designed especially for system administration. This reference topic for the
information technology ﴾IT﴿ professional provides assistance in utilizing the Windows PowerShell cmdlets to script and automate tasks.
Hyper‐V
This reference provides cmdlet descriptions and syntax for all Hyper‐V‐specific cmdlets. It lists the cmdlets in alphabetical order based on the verb at the beginning of
the cmdlet.
cmdlet Description
Add‐VMFibreChannelHba Installs a virtual Fibre Channel host bus adapter in a virtual machine ﴾VM﴿.
Add‐VMMigrationNetwork Adds a network to the list of networks that can be used for virtual machine ﴾VM﴿ migration.
Add‐VMNetworkAdapterAcl Creates an access control list ﴾ACL﴿ to apply to the traffic sent or received by a virtual machine ﴾VM﴿ network adapter.
Add‐ Adds a routing domain and virtual subnets to a virtual network adapter.
VmNetworkAdapterRoutingDomainMapping
Add‐VMSwitchExtensionPortFeature Adds a flow sheet document ﴾FSD﴿ to a virtual network adapter in a virtual machine or the management operating
system ﴾which runs the Hyper‐V role﴿.
Compare‐VM Compares a virtual machine ﴾VM﴿ to a host and returns a compatibility report.
Connect‐VMSan Associates a host bus adapter with a virtual storage area network ﴾VMSAN﴿.
Convert‐VHD Converts the format version and type of virtual hard disk file of a virtual machine ﴾VM﴿.
Disable‐VMRemoteFXPhysicalVideoAdapter Disables a particular RemoteFX physical graphics processing unit ﴾GPU﴿ adapter for use with a RemoteFX virtual
machine ﴾VM﴿.
Disable‐VMResourceMetering Disables resource utilization data collection for a virtual machine ﴾VM﴿ or a resource pool.
Disable‐VMSwitchExtension Disables one or more extensions —and the feature sets associated with each extension— for one or more specified
switches.
Disconnect‐VMNetworkAdapter Disconnects a virtual network adapter from a virtual network or a network resource pool.
Disconnect‐VMSan Removes a host bus adapter from a virtual storage area network ﴾VMSAN﴿.
Dismount‐VHD Specifies the path to the files representing the virtual hard disks to be dismounted.
Enable‐VMEventing Enables the automatic refresh of Hyper‐V objects —"live" objects— for the current Windows PowerShell session.
Enable‐VMRemoteFXPhysicalVideoAdapter Enables one or more RemoteFX physical video adapters for use with RemoteFX‐enabled virtual machines.
Enable‐VMResourceMetering Enables the collection of resource utilization data for one or more virtual machines ﴾VM﴿ or resource pools.
Enable‐VMSwitchExtension Enables one or more extensions —and the feature sets associated with each extension— on one or more specified
virtual switches.
Get‐VHD Creates a VHDObject for each virtual hard disk file specified by path or associated with a virtual machine ﴾VM﴿.
Get‐VM Retrieves a VMObject for each virtual machine ﴾VM﴿ on the Hyper‐V host.
Get‐VMComPort Retrieves a list of the COM ports associated with a virtual machine ﴾VM﴿.
Get‐VMConnectAccess Retrieves a list of users that have access to connect to a virtual machine ﴾VM﴿.
Get‐VMDvdDrive Retrieves a list of DVD drives that are attached to a virtual machine ﴾VM﴿.
Get‐VMFibreChannelHba Retrieves a list of all Fibre Channel host bus adapters associated with a virtual machine ﴾VM﴿.
Get‐VMFloppyDiskDrive Retrieves a list of floppy disk drives that are attached to a virtual machine ﴾VM﴿.
Get‐VMHardDiskDrive Retrieves a list of the hard disk drives that are attached to a virtual machine ﴾VM﴿.
Get‐VMIdeController Retrieves a list of the IDE controllers associated with a virtual machine ﴾VM﴿.
Get‐VMMigrationNetwork Retrieves a list of the networks that have been added for migration on a Hyper‐V host.
Get‐VMNetworkAdapter Retrieves a list of the virtual network adapters of a virtual machine ﴾VM﴿, the management operating system, or both.
Get‐VMNetworkAdapterAcl Retrieves an access control list ﴾ACL﴿ configured for a virtual machine ﴾VM﴿ network adapter.
Get‐ Retrieves the Failover IP settings on a virtual machine ﴾VM﴿ network adaptor.
VMNetworkAdapterFailoverConfiguration
Get‐VMNetworkAdapterVlan Retrieves virtual local area network ﴾VLAN﴿ settings configured on a virtual network adapter.
Get‐VMRemoteFXPhysicalVideoAdapter Retrieves a list of physical graphics processing unit ﴾GPU﴿ adapters in the server that can be used with RemoteFX.
Get‐VMReplication Retrieve a list of virtual machine ﴾VM﴿ replication plans or a specific replication plan and associated settings.
Get‐VMResourcePool Retrieves the resource pools that meet the specified criteria.
Get‐VMSan Retrieves a list of virtual storage area networks ﴾VMSANs﴿ available on a host.
Get‐VMScsiController Retrieves the virtual SCSI controllers for a virtual machine ﴾VM﴿.
Get‐VMSwitch Retrieves the virtual network from a virtual machine ﴾VM﴿ host.
Get‐VMSwitchExtension Retrieves a list of the switch extensions on one or more virtual switches.
Get‐VMSwitchExtensionPortData Retrieves the status or the statistics for the extension of a virtual switch ﴾VMSwitch﴿ applied on a virtual network
adapter.
Get‐VMSwitchExtensionSwitchData Retrieves the status or the statistics for the extension of a virtual switch ﴾VMSwitch﴿ applied on a VMSwitch.
Get‐VMSystemSwitchExtension Retrieves a list of the switch extensions that are installed on a physical server at a system level.
Get‐VMSystemSwitchExtensionPortFeature Retrieves the default instance of the port level feature or features available in an extension at a system level.
Get‐ Retrieves the default instance of the switch level feature or features available in an extension at a system level.
VMSystemSwitchExtensionSwitchFeature
Merge‐VHD Merges virtual hard disks ﴾VHDs﴿ in a differencing virtual hard disk ﴾VHD﴿ chain.
Mount‐VHD Mounts one or more virtual hard disks ﴾VHDs﴿ specified by one or more virtual hard disk ﴾VHD﴿ files.
Move‐VM Migrates an offline virtual machine ﴾VM﴿ or Live Migrates a running virtual machine ﴾VM﴿.
New‐VHD Creates one or more new virtual hard disk ﴾VHD﴿ files.
New‐VMReplicationAuthorizationEntry Creates an authorization entry containing the allowed primary server and corresponding replica storage.
New‐VMSan Creates a new virtual storage area network ﴾VMSAN﴿ on a Hyper‐V host.
Optimize‐VHD Compacts one or more dynamic or differencing virtual hard disk ﴾VHD﴿ files.
Remove‐VMDvdDrive Deletes one or more virtual DVD drives from a virtual machine ﴾VM﴿.
Remove‐VMFibreChannelHba Deletes a Fibre Channel host bus adapter from a virtual machine ﴾VM﴿ configuration.
Remove‐VMHardDiskDrive Deletes one or more virtual hard disks ﴾VHDs﴿ from a virtual machine ﴾VM﴿.
Remove‐VMMigrationNetwork Deletes a network from the list of networks that can be used for virtual machine ﴾VM﴿ migration.
Remove‐VMNetworkAdapter Deletes one or more network adapters from a virtual machine ﴾VM﴿.
Remove‐VMNetworkAdapterAcl Deletes an access control list ﴾ACL﴿ applied to a virtual machine ﴾VM﴿ network adapter for traffic that is sent or
received.
Remove‐VMSan Deletes a virtual storage area network ﴾VMSAN﴿ from a Hyper‐V host.
Remove‐VMSavedState Deletes the saved state of a saved virtual machine ﴾VM﴿.
Remove‐VMScsiController Deletes one or more SCSI controllers from a virtual machine ﴾VM﴿.
Remove‐VMStoragePath Deletes a path from a virtual machine ﴾VM﴿ storage resource pool.
Remove‐VMSwitchExtensionPortFeature Deletes a flow sheet document ﴾FSD﴿ from a virtual network adapter.
Rename‐VMNetworkAdapter Renames a virtual network adapter on a virtual machine or on the management operating system.
Repair‐VM Restores one or more virtual machines ﴾VMs﴿ to usable condition based upon adjustments ─fixes─ contained in each
compatibility report.
Reset‐VMReplicationStatistics Resets the data collected about resource utilization for a virtual machine ﴾VM﴿ or a resource pool.
Reset‐VMResourceMetering Resets the resource utilization data collected by Hyper‐V resource metering.
Restart‐VM Restarts a virtual machine ﴾VM﴿ immediately with shutting down the operating system.
Revoke‐VMConnectAccess Revokes the access assigned to a user for connections to a virtual machine ﴾VM﴿.
Set‐VHD Modifies the differencing virtual hard disk ﴾VHD﴿ chain settings to assign the parent of a virtual hard disk file ﴾VHD﴿.
Set‐VMComPort Modifies the virtual COM port settings for a virtual machine ﴾VM﴿.
Set‐VMDvdDrive Modifies the virtual DVD drive settings for a virtual machine ﴾VM﴿.
Set‐VMFibreChannelHba Modifies the existing Fibre Channel host bus adapter settings for a virtual machine ﴾VM﴿.
Set‐VMFloppyDiskDrive Modifies the virtual floppy drive ﴾VFD﴿ settings for a virtual machine ﴾VM﴿.
Set‐VMHardDiskDrive Modifies the virtual hard disk ﴾VHD﴿ drive settings for a virtual machine ﴾VM﴿.
Set‐VMMigrationNetwork Sets the subnet, subnet mask, and/or priority of a migration network.
Set‐VMNetworkAdapter Modifies the network adapter settings for a virtual machine ﴾VM﴿.
Set‐ Modifies the Failover IP settings of the network adapter for a virtual machine ﴾VM﴿.
VMNetworkAdapterFailoverConfiguration
Set‐VMNetworkAdapterVlan Modifies the virtual local area network ﴾VLAN﴿ settings configured on a virtual machine ﴾VM﴿ network adapter.
Set‐VMProcessor Modifies the virtual processor settings for a virtual machine ﴾VM﴿.
Set‐VMRemoteFx3dVideoAdapter Modifies the RemoteFX adapter settings for a virtual machine ﴾VM﴿.
Set‐VMReplication Modifies the replication relationship settings for a virtual machine ﴾VM﴿.
Set‐VMReplicationServer Modifies the settings that specify the server authentication and the associated ports of the recovery server for a
virtual machine ﴾VM﴿.
Set‐VMResourcePool Modifies the settings that specify the relationship between two resource pools.
Set‐VMSan Modifies the existing virtual machine storage area network ﴾VMSAN﴿ settings on the Hyper‐V host.
Set‐VMSwitch Modifies the virtual network settings for a virtual machine ﴾VM﴿.
Set‐VMSwitchExtensionPortFeature Modifies an existing flow sheet document ﴾FSD﴿ of a virtual machine network interface controller ﴾VMNIC﴿ or parent
virtual network interface controller ﴾VNIC﴿ for a virtual machine ﴾VM﴿.
Set‐VMSwitchExtensionSwitchFeature Modifies an existing flow sheet document ﴾FSD﴿ of a vmswitch for a virtual machine ﴾VM﴿.
Start‐VM Intiates a virtual machine ﴾VM﴿ that is shutdown —off—, hibernated —saved—, or suspended —paused—.
Test‐VHD Verifies the usability of one of more virtual hard disk ﴾VHD﴿ files.
Note
To view a list all the cmdlets that are available for Hyper‐V, run the Get‐Command ‐Module Hyper‐V command.
For more information about, or for the syntax of, any of the cmdlets, use the Get‐Help <cmdlet name> cmdlet, where <cmdlet name> is the name of the cmdlet that
you want to research. For more detailed information, you can run any of the following cmdlets:
● Get‐Help <cmdlet name> ‐Detailed
● Get‐Help <cmdlet name> ‐Examples
● Get‐Help <cmdlet name> ‐Full
© 2015 Microsoft
Add‐VMDvdDrive
Windows Server 2012 R2 and Windows 8.1
Add‐VMDvdDrive
Adds a DVD drive to a virtual machine.
Syntax
Parameter Set: VMName
Add‐VMDvdDrive [‐VMName] <String[]> [[‐ControllerNumber] <Int32> ] [[‐ControllerLocation] <Int32> ] [[‐Path] <String> ] [‐AllowUnverifiedPa
Parameter Set: VMDriveController
Add‐VMDvdDrive [‐VMDriveController] <VMDriveController[]> [[‐ControllerLocation] <Int32> ] [[‐Path] <String> ] [‐AllowUnverifiedPaths] [‐Pa
Parameter Set: VMObject
Add‐VMDvdDrive [‐VM] <VirtualMachine[]> [[‐ControllerNumber] <Int32> ] [[‐ControllerLocation] <Int32> ] [[‐Path] <String> ] [‐AllowUnverifi
Detailed Description
The Add‐VMDvdDrive cmdlet adds a DVD drive to a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐v hosts on which the DVD drive is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The default
is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐ControllerLocation<Int32>
Specifies the number of the location on the controller at which the DVD drive is to be added. If not specified, the number of the first available location on the controller
is used.
Aliases none
Required? false
Position? 4
‐ControllerNumber<Int32>
Specifies the number of the controller to which the DVD drive is to be added. If not specified, the first IDE controller on which the specified ControllerLocation is
available is used.
Aliases none
Required? false
Position? 3
‐Passthru
Passes the added Microsoft.HyperV.PowerShell.DvdDrive through to the pipeline.
Aliases none
Required? false
Position? named
‐Path<String>
Specifies the full path to the virtual hard disk file or physical hard disk volume for the added DVD drive.
Aliases none
Required? false
Position? 5
‐ResourcePoolName<String>
Specifies the friendly name of the ISO resource pool to which this DVD drive is to be associated.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine to which the DVD drive is to be added.
Aliases none
Required? true
Position? 1
‐VMDriveController<VMDriveController[]>
Specifies the drive controller to which the DVD drive is to be added.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine to which the DVD drive is to be added.
Aliases none
Required? true
Position? 1
‐AllowUnverifiedPaths
Specifies that no error is to be thrown if the specified path is not verified as accessible by the cluster. This parameter is applicable to clustered virtual machines.
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.VMDriveController[]
Microsoft.HyperV.PowerShell.VirtualMachine[]
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.DvdDrive
Examples
Example 1
This example adds a virtual DVD drive using file D:\ISOs\disc1.iso to virtual machine Test.
Windows PowerShell
PS C:\> Add‐VMDvdDrive ‐VMName Test –Path D:\ISOs\disc1.iso
Example 2
This example adds a virtual DVD drive using controller number 1 to virtual machine Test.
Windows PowerShell
PS C:\> Get‐VM Test | Add‐VMDvdDrive ‐ControllerNumber 1
Example 3
This example adds virtual DVD drives using the IDE controllers from virtual machine Test.
Windows PowerShell
PS C:\> Get‐VMIdeController –VMName Test | Add‐VMDvdDrive –Path E:\
© 2015 Microsoft
Add‐VMFibreChannelHba
Windows Server 2012 R2 and Windows 8.1
Add‐VMFibreChannelHba
Adds a virtual Fibre Channel host bus adapter to a virtual machine.
Syntax
Parameter Set: VMName and GenerateWwn
Add‐VMFibreChannelHba [‐VMName] <String> [‐SanName] <String> [‐ComputerName <String[]> ] [‐GenerateWwn] [‐Passthru] [‐Confirm] [‐WhatIf] [
Parameter Set: VM object and GenerateWwn
Add‐VMFibreChannelHba [‐VM] <VirtualMachine[]> [‐SanName] <String> [‐GenerateWwn] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VM Object and manual WWN
Add‐VMFibreChannelHba [‐VM] <VirtualMachine[]> [‐SanName] <String> ‐WorldWideNodeNameSetA <String> ‐WorldWideNodeNameSetB <String> ‐WorldWi
Parameter Set: VMName and manual WWN
Add‐VMFibreChannelHba [‐VMName] <String> [‐SanName] <String> ‐WorldWideNodeNameSetA <String> ‐WorldWideNodeNameSetB <String> ‐WorldWidePort
Detailed Description
The Add‐VMFibreChannelHba cmdlet adds a virtual Fibre Channel host bus adapter to a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a virtual Fibre Channel host bus adapter is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Passthru
Specifies that an object representing the virtual machine to which the virtual Fibre Channel host bus adapter being added is to be passed through to the pipeline.
Aliases none
Required? false
Position? named
‐SanName<String>
Specifies the virtual storage area network ﴾SAN﴿ name to associate with this virtual Fibre Channel host bus adapter. Use the Get‐VMSan cmdlet to get a list of all virtual
SANs on the host.
Aliases none
Required? true
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine to which the virtual Fibre Channel host bus adapter is to be added.
Aliases none
Required? true
Position? 1
Default Value none
‐VMName<String>
Specifies the name of the virtual machine to which the virtual Fibre Channel host bus adapter is to be added.
Aliases none
Required? true
Position? 1
‐WorldWideNodeNameSetA<String>
Specifies the world wide node name of address A associated with the Fibre Channel host bus adapter to be added.
Aliases Wwnn1
Required? true
Position? named
‐WorldWideNodeNameSetB<String>
Specifies the world wide node name of address B associated with the Fibre Channel host bus adapter to be added.
Aliases Wwnn2
Required? true
Position? named
‐WorldWidePortNameSetA<String>
Specifies the world wide port name of address A associated with the Fibre Channel host bus adapter to be added.
Aliases Wwpn1
Required? true
Position? named
‐WorldWidePortNameSetB<String>
Specifies the world wide port name of address B associated with the Fibre Channel host bus adapter to be added.
Aliases Wwpn2
Required? true
Position? named
‐GenerateWwn
Specifies that the world wide names for the Fibre Channel host bus adapter are to be generated automatically. When specified, the WorldWideNodeNameSetA,
WorldWideNodeNameSetB, WorldWidePortNameSetA, and WorldWidePortNameSetB parameters cannot be used.
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example adds the virtual Fibre Channel host bus adapter associated with virtual storage area network Production to a virtual machine named MyVM.
Windows PowerShell
PS C:\> Add‐VMFibreChannelHba –VMName MyVM –SanName Production
© 2015 Microsoft
Add‐VMHardDiskDrive
Windows Server 2012 R2 and Windows 8.1
Add‐VMHardDiskDrive
Adds a hard disk drive to a virtual machine.
Syntax
Parameter Set: VMName
Add‐VMHardDiskDrive [‐VMName] <String[]> [[‐ControllerType] <ControllerType> ] [[‐ControllerNumber] <Int32> ] [[‐ControllerLocation] <Int32
Parameter Set: VMDriveController
Add‐VMHardDiskDrive [‐VMDriveController] <VMDriveController> [[‐ControllerLocation] <Int32> ] [[‐Path] <String> ] [‐AllowUnverifiedPaths] [
Parameter Set: VMObject
Add‐VMHardDiskDrive [‐VM] <VirtualMachine[]> [[‐ControllerType] <ControllerType> ] [[‐ControllerNumber] <Int32> ] [[‐ControllerLocation] <I
Detailed Description
The Add‐VMHardDiskDrive cmdlet adds a hard disk drive to a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more virtual machine hosts on which the hard disk drive is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases PSComputerName
Required? false
Position? named
Default Value .
‐ControllerLocation<Int32>
Specifies the number of the location on the controller at which the hard disk drive is to be added. If not specified, the first available location in the controller specified
with the ControllerNumber parameter is used.
Aliases none
Required? false
Position? 4
‐ControllerNumber<Int32>
Specifies the number of the controller to which the hard disk drive is to be added. If not specified, this parameter assumes the value of the first available controller at
the location specified in the ControllerLocation parameter.
Aliases none
Required? false
Position? 3
Aliases none
Required? false
Position? 2
‐Passthru
Passes the added Microsoft.HyperV.PowerShell.HardDiskDrive object through to the pipeline.
Aliases none
Required? false
Position? named
‐Path<String>
Specifies the full path of the hard disk drive file to be added.
Aliases none
Required? false
Position? 5
‐ResourcePoolName<String>
Specifies the friendly name of the ISO resource pool to which this virtual hard disk is to be associated.
Aliases none
Required? false
Position? named
Default Value none
‐SupportPersistentReservations
Indicates that the hard disk supports SCSI persistent reservation semantics. Specify this parameter when the hard disk is a shared disk that is used by multiple virtual
machines.
Aliases ShareVirtualDisk
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine to which the hard disk drive is to be added.
Aliases none
Required? true
Position? 1
‐VMDriveController<VMDriveController>
Specifies the controller to which the hard disk drive is to be added.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine to which the hard disk drive is to be added.
Aliases none
Required? true
Position? 1
‐AllowUnverifiedPaths
Specifies that no error is to be thrown if the specified path is not verified as accessible by the cluster. This parameter is applicable to clustered virtual machines.
Aliases none
Required? false
Position? named
‐DiskNumber<UInt32>
Specifies the disk number of the offline physical hard drive to be connected as a passthrough disk.
Aliases Number
Required? false
Position? named
‐MaximumIOPS<UInt64>
Specifies the maximum normalized I/O operations per second ﴾IOPS﴿ for the hard disk. Hyper‐V calculates normalized IOPS as the total size of I/O per second divided by
8 KB.
Aliases none
Required? false
Position? named
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.Powershell.DriveController[]
Microsoft.HyperV.Powershell.VirtualMachine[]
Outputs
The output type is the type of the objects that the cmdlet emits.
None by default; Microsoft.HyperV.PowerShell.HardDiskDrive if –PassThru is specified.
Examples
Example 1
Creates a virtual hard disk using file D:\VHDs\disk1.vhdx on virtual machine Test.
Windows PowerShell
PS C:\> Add‐VMHardDiskDrive ‐VMName Test ‐Path D:\VHDs\disk1.vhdx
Example 2
Adds a virtual hard disk to SCSI controller number 0 on virtual machine Test.
Windows PowerShell
PS C:\> Get‐VM Test | Add‐VMHardDiskDrive –ControllerType SCSI ‐ControllerNumber 0
Example 3
This example gets a SCSI controller on a virtual machine named Test and then adds physical disk 2 to that controller.
Windows PowerShell
PS C:\> Get‐VMScsiController –VMName Test –Number 0 | Add‐VMHardDiskDrive –DiskNumber 2
Example 4
This example gets physical disk 2 and then adds it to a virtual machine named Test.
Windows PowerShell
PS C:\> Get‐Disk 2 | Add‐VMHardDiskDrive –VMName Test
© 2015 Microsoft
Add‐VMMigrationNetwork
Windows Server 2012 R2 and Windows 8.1
Add‐VMMigrationNetwork
Adds a network for virtual machine migration on one or more virtual machine hosts.
Syntax
Parameter Set: Default
Add‐VMMigrationNetwork [‐Subnet] <String> [[‐Priority] <UInt32> ] [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonPar
Detailed Description
The Add‐VMMigrationNetwork cmdlet adds a network for virtual machine migration on one or more virtual machine hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the network is to be added for virtual machine migration. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Passthru
Specifies that an Microsoft.HyperV.PowerShell.MigrationNetwork object is to be passed through to the pipeline representing the network added for virtual machine
migration.
Aliases none
Required? false
Position? named
‐Priority<UInt32>
Specifies the priority of the network to be added for virtual machine migration. Multiple networks can have the same priority.
Aliases none
Required? false
Position? 2
‐Subnet<String>
Specifies a string representing an IPv4 or IPv6 subnet mask which identifies the network to be added for virtual machine migration.
Aliases none
Required? true
Position? 1
Default Value none
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example adds an IPv4 address as a live migration network on the local Hyper‐V host.
Windows PowerShell
PS C:\> Add‐VMMigrationNetwork 192.168.0.1
Example 2
This example adds an IPv4 address range as possible live migration networks on the local Hyper‐V host by using a subnet mask.
Windows PowerShell
PS C:\> Add‐VMMigrationNetwork 192.168.10.0/24
Example 3
This example adds an IPv6 address range as possible live migration networks on the local Hyper‐V host by adding a subnet mask.
Windows PowerShell
PS C:\> Add‐VMMigrationNetwork 2001:836c:6456:1c99::/32
Example 4
This example adds an IPv6 address range as possible live migration networks on the local Hyper‐V host by using a subnet mask and specifying the network as lower
priority.
Windows PowerShell
PS C:\> Add‐VMMigrationNetwork 2001:836c:6456:1c99::/64 –Priority 8
© 2015 Microsoft
Add‐VMNetworkAdapter
Windows Server 2012 R2 and Windows 8.1
Add‐VMNetworkAdapter
Adds a virtual network adapter to a virtual machine.
Syntax
Parameter Set: VMName
Add‐VMNetworkAdapter [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐DynamicMacAddress] [‐IsLegacy <Boolean> ] [‐Name <String> ] [‐Passt
Parameter Set: ManagementOS
Add‐VMNetworkAdapter [‐ComputerName <String[]> ] [‐DynamicMacAddress] [‐ManagementOS] [‐Name <String> ] [‐Passthru] [‐StaticMacAddress <Str
Parameter Set: VMObject
Add‐VMNetworkAdapter [‐VM] <VirtualMachine[]> [‐DynamicMacAddress] [‐IsLegacy <Boolean> ] [‐Name <String> ] [‐Passthru] [‐ResourcePoolName
Detailed Description
The Add‐VMNetworkAdapter cmdlet adds a virtual network adapter to a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the virtual network adapter is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐DynamicMacAddress
Assigns a dynamically generated MAC address to the new virtual network adapter.
Aliases none
Required? false
Position? named
‐IsLegacy<Boolean>
Specifies whether the virtual network adapter is the legacy type.
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies the management operating system.
Aliases none
Required? false
Position? named
‐Name<String>
Specifies a name for the new virtual network adapter. The default value is “Network Adapter.”
Aliases VMNetworkAdapterName
Required? false
Position? named
‐Passthru
Specifies that an object is to be passed through to be pipeline representing the network adapter to be added. If you specify –ManagementOS, the object passed is a
Microsoft.HyperV.PowerShell.VMInternalNetworkAdapter; otherwise the object passed is a Microsoft.HyperV.PowerShell.VMNetworkAdapter.
Aliases none
Required? false
Position? named
‐ResourcePoolName<String>
Specifies the friendly name of a resource pool.
Aliases none
Required? false
Position? named
‐StaticMacAddress<String>
Assigns a specific MAC address to the new virtual network adapter.
Aliases none
Required? false
Position? named
‐SwitchName<String>
Specifies the name of the virtual switch to connect to the new network adapter. If the switch name is not unique, then the operation fails.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine on which the network adapter is to be added.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine on which the network adapter is to be added.
Aliases none
Required? true
Position? 1
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example adds a virtual network adapter named Redmond NIC1 to a virtual machine named Redmond.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapter –VMName Redmond –Name "Redmond NIC1"
Example 2
This example adds a virtual network adapter to a virtual machine named Test and connects it to a virtual switch named Network.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapter ‐VMName Test ‐SwitchName Network
Example 3
This example uses two cmdlets and the pipeline in one command to perform the operation.
Windows PowerShell
PS C:\> Get‐VM Test | Add‐VMNetworkAdapter ‐IsLegacy $true –Name Bootable
Example 4
This example adds a second virtual network adapter in the management operating system.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapter ‐ManagementOS ‐Name Secondary
© 2015 Microsoft
Add‐VMNetworkAdapterAcl
Windows Server 2012 R2 and Windows 8.1
Add‐VMNetworkAdapterAcl
Creates an ACL to apply to the traffic through a virtual machine network adapter.
Syntax
Parameter Set: VMName
Add‐VMNetworkAdapterAcl [‐VMName] <String[]> ‐Action <VMNetworkAdapterAclAction> ‐Direction <VMNetworkAdapterAclDirection> [‐ComputerName <
Parameter Set: ManagementOS
Add‐VMNetworkAdapterAcl ‐Action <VMNetworkAdapterAclAction> ‐Direction <VMNetworkAdapterAclDirection> ‐ManagementOS [‐ComputerName <String[
Parameter Set: ResourceObject
Add‐VMNetworkAdapterAcl [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> ‐Action <VMNetworkAdapterAclAction> ‐Direction <VMNetworkAdapterAclDir
Parameter Set: VMObject
Add‐VMNetworkAdapterAcl [‐VM] <VirtualMachine[]> ‐Action <VMNetworkAdapterAclAction> ‐Direction <VMNetworkAdapterAclDirection> [‐LocalIPAdd
Detailed Description
The Add‐VMNetworkAdapterAcl cmdlet creates an ACL to apply to the traffic through a virtual machine network adapter. When a virtual network adapter is created
there is no ACL on it. Given a list of IP‐based ACL entries to be applied to traffic in the same direction, the longest match rule decides which one of the entries is most
appropriate to apply to a specific packet.
Parameters
‐Action<VMNetworkAdapterAclAction>
Specifies the action for the ACL. Allowed values are Allow, Deny, and Meter. A metering ACL must be IP‐based, i.e. either ‐RemoteIPAddress or ‐LocalIPAddress must
be specified.
Aliases none
Required? true
Position? named
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the ACL is to be created. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The default is the
local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Direction<VMNetworkAdapterAclDirection>
Specifies the direction of the network traffic to which the ACL is to apply. Allowed values are Inbound, Outbound, or Both. . If Both is specified, the new ACL entry is
added to both the inbound direction and the outbound direction. In the output of Get‐VMNetworkAdapterAcl, the ACL entry appears in both the inbound ACL list and
the outbound ACL list.
Aliases none
Required? true
Position? named
‐LocalIPAddress<String[]>
Specifies the local IP address to which the ACL is to apply. For an inbound packet, this is the destination IP address in the packet header; for an outbound packet, this is
the source IP address in the packet header. It can be either IPv4 or IPv6 address. It can be either a host address or a subnet address, e.g. 1.2.3.4, 2001::2008,
192.168.1.0/24, or f001:f002:f003:f004::1/64. The IP address can also be a wildcard, 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all IPv4 and IPv6
addresses.
Aliases none
Required? false
Position? named
‐LocalMacAddress<String[]>
Specifies the local MAC address to which the ACL is to apply. For an inbound packet, this is the destination MAC address in the packet header; for an outbound packet,
this is the source MAC address in the packet header. It can be a host MAC address, e.g. 00‐ab‐00‐11‐22‐33, or a wildcard, ANY, for all MAC addresses.
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies that the ACL is to be applied in the management ﴾i.e. the parent, or host﴿ operating system.
Aliases none
Required? true
Position? named
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the ACL to be added.
Aliases none
Required? false
Position? named
‐RemoteIPAddress<String[]>
Specifies the remote IP address to which this ACL is to apply. For an inbound packet, this is the source IP address in the packet header; for an outbound packet, this is
the destination IP address in the packet header. It can be either IPv4 or IPv6 address. It can be either a host address or a subnet address, e.g. 1.2.3.4, 2001::2008,
192.168.1.0/24, or f001:f002:f003:f004::1/64.the IP address can also be a wildcard, 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all IPv4 and IPv6
addresses.
Aliases none
Required? false
Position? named
‐RemoteMacAddress<String[]>
Specifies the remote MAC address to which this ACL is to apply. For an inbound packet, this is the source MAC address in the packet header; for an outbound packet,
this is the destination MAC address in the packet header. It can be a host MAC address, e.g. 00‐ab‐00‐11‐22‐33, or a wildcard, ANY, for all MAC addresses.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine on which the ACL is to apply.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine on which the ACL is to apply.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual machine network adapter to which the ACL is to apply.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of the virtual machine network adapter to which the ACL is to apply.
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example adds an ACL to allow virtual machine Redmond to send to and receive from traffic on IP subnet 10.0.0.8/8.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapterAcl –VMName Redmond –RemoteIPAddress 10.0.0.0/8 –Direction Both –Action Allow
Example 2
This example adds an ACL to deny virtual machine Redmond to send either IPv4 or IPv6 traffic to anywhere and receive such traffic from anywhere.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapterAcl –VMName Redmond –RemoteIPAddress ANY –Direction Both –Action Deny
Example 3
This example gets virtual machine Redmond and adds an ACL to deny it to send any traffic to a device with MAC address 03‐0f‐01‐0e‐aa‐b2 or to receive any traffic
from that device.
Windows PowerShell
PS C:\> Get‐VM Redmond | Add‐VMNetworkAdapterAcl ‐RemoteMacAddress 03‐0f‐01‐0e‐aa‐b2 ‐Direction Both ‐Action Deny
Example 4
This example gets virtual network adapters from virtual machine Redmond and adds an ACL to meter outgoing traffic sent to IP subnet 192.168.0.0/16.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapter ‐VMName Redmond | Add‐VMNetworkAdapterAcl ‐RemoteIPAddress 192.168.0.0/16 ‐Direction Outbound ‐Action Meter
© 2015 Microsoft
Add‐VMNetworkAdapterExtendedAcl
Windows Server 2012 R2 and Windows 8.1
Add‐VMNetworkAdapterExtendedAcl
Creates an extended ACL for a virtual network adapter.
Syntax
Parameter Set: VMName
Add‐VMNetworkAdapterExtendedAcl [‐VMName] <String[]> [‐Action] <VMNetworkAdapterExtendedAclAction> [‐Direction] <VMNetworkAdapterExtendedAc
Parameter Set: ManagementOS
Add‐VMNetworkAdapterExtendedAcl [‐Action] <VMNetworkAdapterExtendedAclAction> [‐Direction] <VMNetworkAdapterExtendedAclDirection> [[‐LocalI
Parameter Set: ResourceObject
Add‐VMNetworkAdapterExtendedAcl [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [‐Action] <VMNetworkAdapterExtendedAclAction> [‐Direction] <VM
Parameter Set: VMObject
Add‐VMNetworkAdapterExtendedAcl [‐VM] <VirtualMachine[]> [‐Action] <VMNetworkAdapterExtendedAclAction> [‐Direction] <VMNetworkAdapterExtend
Detailed Description
The Add‐VMNetworkAdapterExtendedAcl cmdlet creates an extended access control list ﴾ACL﴿ for a virtual network adapter. The ACL allows or denies access to a
virtual machine network adapter for network packets based on source IP address, destination IP address, protocol, source port, and destination port.
Parameters
‐Action<VMNetworkAdapterExtendedAclAction>
Specifies the action for the ACL. The acceptable values for this parameter are:
‐‐ Allow
‐‐ Deny
Aliases none
Required? true
Position? 2
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet adds the ACL to the network adapters on the Hyper‐V hosts that you specify.
Aliases none
Required? false
Position? named
‐Direction<VMNetworkAdapterExtendedAclDirection>
Specifies the direction of network traffic, from the perspective of the virtual machine, to which the ACL applies. The cmdlet adds an ACL that has the value that you
specify. The acceptable values for this parameter are:
‐‐ Inbound
‐‐ Outbound
If you run the Get‐VMNetworkAdapterExtendedAcl cmdlet, the entry that you create appears in both the inbound ACL and the outbound ACL.
Aliases none
Required? true
Position? 3
‐IdleSessionTimeout<Int32>
Specifies a time‐out period, in seconds, for idle sessions.
Aliases none
Required? false
Position? named
‐IsolationID<Int32>
Specifies an ID of a virtual subnet. The cmdlet adds an ACL that applies to traffic on the isolated network that you specify. The subnet uses virtual local area network
﴾VLAN﴿ or Hyper‐V Network Virtualization. For more information about isolation IDs, see the Set‐VmNetworkAdapterIsolation cmdlet.
Aliases none
Required? false
Position? named
‐LocalIPAddress<String>
Specifies the local IP address for the ACL. For an inbound packet, the local address is the destination IP address. For an outbound packet, the local address is the source
IP address. You can specify a host address or a subnet address, or specify a wildcard, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all
IPv4 and IPv6 addresses.
Aliases none
Required? false
Position? 4
‐LocalPort<String>
Specifies the local port for the ACL. For an inbound TCP or UDP packet, the local port is the destination port. For an outbound packet, the local port is the source port.
Aliases none
Required? false
Position? 6
‐ManagementOS
Indicates that the cmdlet operates on the parent or host operating system. If you specify this parameter, this cmdlet creates an ACL that applies to the parent or host
operating system.
Aliases none
Required? true
Position? named
‐Passthru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Aliases none
Required? false
Position? named
‐Protocol<String>
Specifies the protocol that the ACL applies to. The acceptable values for this parameter are:
‐‐ TCP
‐‐ UDP
‐‐ ICMP
‐‐ an integer IP protocol ID
Aliases none
Required? false
Position? 8
‐RemoteIPAddress<String>
Specifies the local IP address for the ACL. For an inbound packet, the remote address is the source IP address. For an outbound packet, the remote address is the
destination IP address. You can specify a host address or a subnet address, or specify a wildcard, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or
ANY for all IPv4 and IPv6 addresses.
Aliases none
Required? false
Position? 5
‐RemotePort<String>
Specifies the remote port for the ACL. For an inbound TCP or UDP packet, the remote port is the source port. For an outbound packet, the remote port is the
destination port.
Aliases none
Required? false
Position? 7
‐Stateful<Boolean>
Indicates whether the ACL applies to packets in both directions of the same session. If you specify a value of $True, the ACL applies to a return packet even though that
packet has the opposite direction with respect to the ACL.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet adds an ACL for the virtual machines that you specify. To obtain a virtual machine object, use the Get‐VM
cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies an array of names of virtual machines. The cmdlet adds an ACL for the virtual machines that you specify.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies an array VM network adapters as VMNetworkAdapterBase objects. The cmdlet adds an ACL to the adapters that you specify. To obtain a network adapter,
use the Get‐VMNetworkAdapter cmdlet.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of a virtual network adapter. The cmdlet adds an ACL to the adapter that you specify.
Aliases none
Required? false
Position? named
‐Weight<Int32>
Specifies the weight of an ACL entry. Larger weight values apply first, and once an ACL entry applies to a packet, other entries are no longer relevant for that packet.
Aliases none
Required? true
Position? 9
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.VMNetworkAdapterExtendedAclSetting
Examples
Example 1: Create an ACL for Remote Desktop Protocol
This command creates a stateful inbound ACL that allows a remote device to connect to the virtual machine on port 3389, which is the port for Remote Desktop
Protocol.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapterExtendedAcl ‐VMName "TSQA01" ‐Action Allow ‐Direction Inbound ‐LocalPort "3389" ‐Protocol "TCP" ‐Weight 10
Windows PowerShell
PS C:\> Add‐VMNetworkAdapterExtendedAcl ‐VMName "TSQA03" ‐Action Allow ‐Direction Outbound ‐RemotePort "80" ‐Protocol "TCP" ‐Weight 100
Related topics
Get‐VMNetworkAdapterExtendedAcl
Remove‐VMNetworkAdapterExtendedAcl
Get‐VM
Set‐VmNetworkAdapterIsolation
© 2015 Microsoft
Add‐VmNetworkAdapterRoutingDomainMapping
Windows Server 2012 R2 and Windows 8.1
Add‐VmNetworkAdapterRoutingDomainMapping
Adds a routing domain and virtual subnets to a virtual network adapter.
Syntax
Parameter Set: VMName
Add‐VmNetworkAdapterRoutingDomainMapping [‐VMName] <String[]> [‐RoutingDomainID] <String> [‐RoutingDomainName] <String> [[‐IsolationID] <In
Parameter Set: ManagementOS
Add‐VmNetworkAdapterRoutingDomainMapping [‐RoutingDomainID] <String> [‐RoutingDomainName] <String> [[‐IsolationID] <Int32[]> ] [[‐Isolation
Parameter Set: ResourceObject
Add‐VmNetworkAdapterRoutingDomainMapping [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [‐RoutingDomainID] <String> [‐RoutingDomainName] <Str
Parameter Set: VMObject
Add‐VmNetworkAdapterRoutingDomainMapping [‐VM] <VirtualMachine[]> [‐RoutingDomainID] <String> [‐RoutingDomainName] <String> [[‐IsolationID]
Detailed Description
The Add‐VmNetworkAdapterRoutingDomainMapping cmdlet adds a routing domain and virtual subnets to a virtual network adapter. The cmdlet adds the
information about the routing domain and virtual subnets to connected multitenant virtual machines.
Parameters
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet adds the routing domain and virtual subnet to a virtual network adapter on the Hyper‐V hosts that you specify.
Aliases none
Required? false
Position? named
‐IsolationID<Int32[]>
Specifies an array of IDs of virtual subnets. The cmdlet adds the virtual subnets that you specify to the virtual network adapter. You can isolate a virtual machine adapter
by using virtual local area network ﴾VLAN﴿, Hyper‐V Network Virtualization, or a third party virtualization solution. For more information about isolation IDs, see the Set‐
VmNetworkAdapterIsolation cmdlet.
Aliases none
Required? false
Position? 4
‐IsolationName<String[]>
Specifies an array of names of virtual subnets. The cmdlet adds the virtual subnets that you specify to the virtual network adapter. The subnet uses VLAN or Hyper‐V
Network Virtualization.
Aliases none
Required? false
Position? 5
‐ManagementOS
Indicates that the cmdlet operates on the parent or host operating system.
Aliases none
Required? true
Position? named
‐Passthru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Aliases none
Required? false
Position? named
‐RoutingDomainID<String>
Specifies the ID of a routing domain. The ID of a routing domain is a system‐assigned GUID. The cmdlet adds the routing domain that you specify to the virtual network
adapter.
Aliases none
Required? true
Position? 2
‐RoutingDomainName<String>
Specifies the name of a routing domain. The cmdlet adds the routing domain that you specify to the virtual network adapter.
Aliases none
Required? true
Position? 3
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet adds the routing domain to the network interfaces that belong to the virtual machines that you specify. To
obtain a virtual machine object, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies an array of friendly names of virtual machines. The cmdlet adds the routing domain to the network interfaces that belong to the virtual machines that you
specify.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies an array of virtual network adapter as VMNetworkAdapterBase objects. The cmdlet adds the routing domain on the adapters that you specify. To obtain a
network adapter, use the Get‐VMNetworkAdapter cmdlet.
Aliases none
Required? true
Position? 1
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Add a tenant and virtual subnet to a multitenant virtual network
This command adds a tenant that has the specified routing domain to the virtual network adapter named Internal NIC that belongs to the multitenant virtual machine
named Gateway01. The command also adds the virtual subnet that has the ID 6000 to the virtual network adapter.
Windows PowerShell
PS C:\> Add‐VMNetworkAdapterRoutingDomainMapping ‐VMName "Gateway01" ‐VMNetworkAdapterName "Internal NIC" –RoutingDomainID "{5a07361e‐6a54‐
Related topics
Get‐VMNetworkAdapterRoutingDomainMapping
Set‐VmNetworkAdapterRoutingDomainMapping
Remove‐VMNetworkAdapterRoutingDomainMapping
Get‐VM
© 2015 Microsoft
Add‐VMRemoteFx3dVideoAdapter
Windows Server 2012 R2 and Windows 8.1
Add‐VMRemoteFx3dVideoAdapter
Adds a RemoteFX video adapter in a virtual machine.
Syntax
Parameter Set: VMName
Add‐VMRemoteFx3dVideoAdapter [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [ <CommonParameters>]
Parameter Set: VMObject
Add‐VMRemoteFx3dVideoAdapter [‐VM] <VirtualMachine[]> [‐Passthru] [ <CommonParameters>]
Detailed Description
The Add‐VMRemoteFx3dVideoAdapter cmdlet adds a RemovteFX video adapter in a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the RemoteFX video adapter is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine on which the RemoteFX video adapter is to be added.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of virtual machine on which the RemoteFX video adapter is to be added.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None by default; Microsoft.HyperV.PowerShell.RemoteFxVideoAdapter if –PassThru is specified.
Examples
Example 1
Adds a RemoteFX video adapter to virtual machine Test.
Windows PowerShell
PS C:\> Add‐VMRemoteFx3dVideoAdapter –VMName Test
Example 2
Adds a RemoteFX video adapter to virtual machine Test.
Windows PowerShell
PS C:\> Get‐VM Test | Add‐VMRemoteFx3dVideoAdapter
© 2015 Microsoft
Add‐VMScsiController
Windows Server 2012 R2 and Windows 8.1
Add‐VMScsiController
Adds a SCSI controller in a virtual machine.
Syntax
Parameter Set: VMName
Add‐VMScsiController [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [ <CommonParameters>]
Parameter Set: VMObject
Add‐VMScsiController [‐VM] <VirtualMachine[]> [‐Passthru] [ <CommonParameters>]
Detailed Description
The Add‐VMScsiController cmdlet adds a SCSI controller in a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a SCSI controller is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
Accept Pipeline Input? false
‐Passthru
Specifies that a VMScsiController object is to be passed through to the pipeline representing the SCSI controller to be added.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine in which the SCSI controller is to be added.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine in which the SCSI controller is to be added.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Adds a SCSI controller in virtual machine TestVM.
Windows PowerShell
PS C:\> Add‐VMScsiController –VMName TestVM
© 2015 Microsoft
Add‐VMStoragePath
Windows Server 2012 R2 and Windows 8.1
Add‐VMStoragePath
Adds a path to a storage resource pool.
Syntax
Parameter Set: Default
Add‐VMStoragePath [‐Path] <String[]> [‐ResourcePoolName] <String[]> [‐ResourcePoolType] <VMResourcePoolType> [‐ComputerName <String[]> ] [‐
Detailed Description
The Add‐VMStoragePath cmdlet adds a path to a storage resource pool.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the path to the storage resource pool is to be added. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐PassThru
Specifies that a String object is to be passed through to the pipeline representing the path to be added to the storage resource pool.
Aliases none
Required? false
Position? named
‐Path<String[]>
Specifies the path to be added to the storage resource pool.
Aliases none
Required? true
Position? 1
‐ResourcePoolName<String[]>
Specifies the name of the resource pool to which the path is to be added.
Aliases none
Required? true
Position? 2
‐ResourcePoolType<VMResourcePoolType>
Specifies the type of the resource pool for which storage paths are to be added. Allowed values are VFD, VHD, and ISO.
Aliases none
Required? true
Position? 3
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Adds path D:\VHD to resource storage pool Engineering Department of type VHD.
Windows PowerShell
PS C:\> Add‐VMStoragePath ‐Path D:\VHD ‐ResourcePoolName "Engineering Department" –ResourcePoolType VHD
© 2015 Microsoft
Add‐VMSwitch
Windows Server 2012 R2 and Windows 8.1
Add‐VMSwitch
Adds a virtual switch to an Ethernet resource pool.
Syntax
Parameter Set: NetworkByName
Add‐VMSwitch [‐Name] <String[]> [‐ResourcePoolName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: NetworkByObject
Add‐VMSwitch [‐VMSwitch] <VMSwitch[]> [‐ResourcePoolName] <String[]> [ <CommonParameters>]
Detailed Description
The Add‐VMSwitch cmdlet adds a virtual switch to an Ethernet resource pool.
Parameters
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet adds the virtual switch on the Hyper‐V hosts that you specify.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the virtual switch to be added.
Aliases none
Required? true
Position? 1
‐ResourcePoolName<String[]>
Specifies the name of the resource pool to which the virtual switch is to be added.
Aliases none
Required? true
Position? 2
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch to be added to the Ethernet resource pool.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Adds virtual switch Test to Ethernet resource pool Engineering Department.
Windows PowerShell
PS C:\> Add‐VMSwitch ‐Name Test ‐ResourcePoolName "Engineering Department"
Example 2
Adds virtual switch Test to Ethernet resource pool Engineering Department.
Windows PowerShell
PS C:\> Get‐VMSwitch –Name Test | Add‐VMSwitch –ResourcePoolName "Engineering Department"
© 2015 Microsoft
Add‐VMSwitchExtensionPortFeature
Windows Server 2012 R2 and Windows 8.1
Add‐VMSwitchExtensionPortFeature
Adds a feature to a virtual network adapter.
Syntax
Parameter Set: VMName
Add‐VMSwitchExtensionPortFeature [‐VMName] <String[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionPortFeature[]> [‐ComputerName <String[]>
Parameter Set: ExternalPort
Add‐VMSwitchExtensionPortFeature [‐SwitchName] <String> ‐ExternalPort ‐VMSwitchExtensionFeature <VMSwitchExtensionPortFeature[]> [‐Computer
Parameter Set: ManagementOS
Add‐VMSwitchExtensionPortFeature ‐ManagementOS ‐VMSwitchExtensionFeature <VMSwitchExtensionPortFeature[]> [‐ComputerName <String[]> ] [‐Pas
Parameter Set: ResourceObject
Add‐VMSwitchExtensionPortFeature [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionPortFeature[]> [‐
Parameter Set: VMObject
Add‐VMSwitchExtensionPortFeature [‐VM] <VirtualMachine[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionPortFeature[]> [‐Passthru] [‐VMNetwor
Detailed Description
The Add‐VMSwitchExtensionPortFeature cmdlet adds a feature supported by a virtual switch extension to a virtual machine network adapter. This cmdlet also
configures built‐in virtual switch features.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a feature is to be added to a virtual network adapter. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐ExternalPort
Specifies the virtual switch port connected to the external network interface card.
Aliases none
Required? true
Position? named
‐ManagementOS
Specifies that the feature is to be added in the management ﴾i.e. the parent, or host﴿ operating system.
Aliases none
Required? true
Position? named
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the feature to be added.
Aliases none
Required? false
Position? named
‐SwitchName<String>
Specifies the name of the virtual switch.
Aliases none
Required? true
Position? 1
‐VM<VirtualMachine[]>
Specifies the virtual machine in which the feature is to be added.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine in which the feature is to be added.
Aliases none
Required? true
Position? 1
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of the virtual machine network adapter for which the feature is to be added.
Aliases none
Required? false
Position? named
‐VMSwitchExtensionFeature<VMSwitchExtensionPortFeature[]>
Specifies the feature to be added to the virtual switch. You can get such a feature object from Get‐VMSystemSwitchExtensionPortFeature to add a new configuration to
a virtual network adapter, or from the Get‐VMSwitchExtensionPortFeature cmdlet to update an existing configuration.
Aliases none
Required? true
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Adds a feature to virtual machine VM2. The feature here is a port security feature supported by the extension Microsoft Virtual Ethernet Switch Native Extension.
Windows PowerShell
PS C:\> $feature = Get‐VMSystemSwitchExtensionPortFeature ‐FeatureName "Ethernet Switch Port Security Settings"
Windows PowerShell
PS C:\> $feature.SettingData.EnableDhcpGuard = $true
Windows PowerShell
PS C:\> $feature.SettingData.EnableRouterGuard = $true
Windows PowerShell
PS C:\> Add‐VMSwitchExtensionPortFeature ‐VMName VM2 ‐VMSwitchExtensionFeature $feature
© 2015 Microsoft
Add‐VMSwitchExtensionSwitchFeature
Windows Server 2012 R2 and Windows 8.1
Add‐VMSwitchExtensionSwitchFeature
Adds a feature to a virtual switch.
Syntax
Parameter Set: SwitchName
Add‐VMSwitchExtensionSwitchFeature [‐SwitchName] <String[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionSwitchFeature[]> [‐ComputerName <St
Parameter Set: SwitchObject
Add‐VMSwitchExtensionSwitchFeature [‐VMSwitch] <VMSwitch[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionSwitchFeature[]> [‐Passthru] [ <Com
Detailed Description
The Add‐VMSwitchExtensionSwitchFeature cmdlet adds a feature supported by a virtual switch extension to a virtual switch.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a feature is to be added to a virtual switch. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the feature to be added.
Aliases none
Required? false
Position? named
‐SwitchName<String[]>
Specifies the name of the virtual switch to which the feature is to be added.
Aliases none
Required? true
Position? 1
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch to which the feature is to be added.
Aliases none
Required? true
Position? 1
‐VMSwitchExtensionFeature<VMSwitchExtensionSwitchFeature[]>
Specifies the feature to be added to the virtual switch.
Aliases none
Required? true
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Adds a feature to virtual switch External.
Windows PowerShell
PS C:\> $feature = Get‐VMSwitchExtensionSwitchFeature –FeatureName "Ethernet Switch BandwidthSettings"
Windows PowerShell
PS C:\> $feature.SettingData.DefaultFlowReservation = 300000000
Windows PowerShell
PS C:\> Add‐VMSwitchExtensionSwitchFeature "External" –VMSwitchExtensionSwitchFeature $feature
© 2015 Microsoft
Checkpoint‐VM
Windows Server 2012 R2 and Windows 8.1
Checkpoint‐VM
Creates a checkpoint of a virtual machine.
Syntax
Parameter Set: Name
Checkpoint‐VM [‐Name] <String[]> [[‐SnapshotName] <String> ] [‐AsJob] [‐ComputerName <String[]> ] [‐Passthru] [ <CommonParameters>]
Parameter Set: VMObject
Checkpoint‐VM [‐VM] <VirtualMachine[]> [[‐SnapshotName] <String> ] [‐AsJob] [‐Passthru] [ <CommonParameters>]
Detailed Description
The Checkpoint‐VM cmdlet creates a checkpoint of a virtual machine.
Note: In Windows Server 2012 R2, virtual machine snapshots were renamed to virtual machine checkpoints. For clarity, this document will refer to virtual machine
snapshots as checkpoints.
Parameters
‐AsJob
Specifies that the cmdlet is to be run as a background job.
Aliases none
Required? false
Position? named
‐ComputerName<String[]>
Specifies one or more virtual machine hosts on which the virtual machine checkpoint is to be created. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the virtual machine of which a checkpoint is to be taken.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the virtual machine of which a checkpoint is to be taken.
Aliases none
Required? false
Position? named
‐SnapshotName<String>
Specifies the name of the checkpoint to be taken. If not provided, a combination of the virtual machine’s name and a current timestamp is used.
Aliases none
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine of which a checkpoint is to be taken.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Checkpoints virtual machine Test, creating a checkpoint of it named BeforeInstallingUpdates.
Windows PowerShell
PS C:\> Checkpoint‐VM ‐Name Test ‐SnapshotName BeforeInstallingUpdates
Example 2
Checkpoints virtual machine Test on Hyper‐V host Server1.
Windows PowerShell
PS C:\> Get‐VM Test –ComputerName Server1 | Checkpoint‐VM
© 2015 Microsoft
Compare‐VM
Windows Server 2012 R2 and Windows 8.1
Compare‐VM
Compares a virtual machine and a virtual machine host for compatibility, returning a compatibility report.
Syntax
Parameter Set: Name
Compare‐VM [‐Name] <String> [‐DestinationHost] <String> [‐AsJob] [‐ComputerName <String[]> ] [‐DestinationStoragePath <String> ] [‐IncludeS
Parameter Set: CompatibilityReport
Compare‐VM [‐CompatibilityReport] <VMCompatibilityReport> [‐AsJob] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: Copy
Compare‐VM [‐Path] <String> [[‐VhdDestinationPath] <String> ] ‐Copy [‐AsJob] [‐ComputerName <String[]> ] [‐GenerateNewId] [‐SmartPagingFile
Parameter Set: Register
Compare‐VM [‐Path] <String> [‐AsJob] [‐ComputerName <String[]> ] [‐Register] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VM
Compare‐VM [‐VM] <VirtualMachine> [‐DestinationHost] <String> [‐AsJob] [‐DestinationStoragePath <String> ] [‐IncludeStorage] [‐ResourcePool
Detailed Description
The Compare‐VM cmdlet compares a virtual machine and a virtual machine host for compatibility, returning a compatibility report. This is useful when trying to import
or migrate a virtual machine that is incompatible with the target Hyper‐V server.
Parameters
‐AsJob
Specifies that the cmdlet is to be run as a background job.
Aliases none
Required? false
Position? named
‐CompatibilityReport<VMCompatibilityReport>
Specifies a compatibility report which resolves any incompatibilities between the virtual machine and the virtual machine host.
Aliases none
Required? true
Position? 1
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the . NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The default is the local computer —
use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐DestinationHost<String>
Specifies the Hyper‐V host to which the virtual machine is to be compared for compatibility.
Aliases none
Required? true
Position? 2
‐DestinationStoragePath<String>
Specifies a destination storage path to which all virtual machine storage is to be moved.
Aliases none
Required? false
Position? named
‐GenerateNewId
Specifies that the virtual machine should be copied and given a new unique identifier.
Aliases none
Required? false
Position? named
‐IncludeStorage
Specifies that the compatibility comparison should include both the virtual machine and its storage.
Aliases none
Required? false
Position? named
‐Name<String>
Specifies the name of the virtual machine to be compared.
Aliases none
Required? true
Position? 1
‐Path<String>
Specifies the path to the configuration file of the virtual machine to be compared.
Aliases none
Required? true
Position? 1
‐VM<VirtualMachine>
Specifies the virtual machine object to be compared.
Aliases none
Required? true
Position? 1
‐ResourcePoolName<String>
Friendly name of the resource pool
Aliases none
Required? false
Position? named
‐RetainVhdCopiesOnSource
Specify this parameter to retain parent virtual hard disks on the source computer.
Aliases none
Required? false
Position? named
‐SmartPagingFilePath<String>
Specifies the new path to use for a smart paging file, if one is needed.
Aliases none
Required? false
Position? named
‐SnapshotFilePath<String>
Specifies the path for any snapshot files associated with the virtual machine.
Aliases none
Required? false
Position? named
‐Vhds<Hashtable[]>
An array of hashtables that specifies a location for each individual virtual hard disk that needs to be moved. Each hashtable has two entries. The first entry specifies the
current location of the virtual hard disk to move, and has a key of SourceFilePath. The second entry specifies the new location for the virtual hard disk, and has a key of
DestinationFilePath. The virtual hard disk names must be identical in both entries.
Aliases none
Required? false
Position? named
‐VirtualMachinePath<String>
Specifies the path where the resulting machine configuration files are to be stored.
Aliases none
Required? false
Position? named
‐Copy
Specifies that the comparison should be made for a copy import operation.
Aliases none
Required? true
Position? named
‐Register
Specifies that the comparison should be made for an in‐place import operation.
Aliases none
Required? false
Position? named
‐VhdDestinationPath<String>
Specifies the folder to which the virtual machine’s VHD is to be copied.
Aliases none
Required? false
Position? 2
‐VhdSourcePath<String>
Specifies the folder from which the virtual machine’s VHD files are to be copied.
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.CompatibilityReport
Examples
Example 1
Compares virtual machine TestVM and Hyper‐V host TestDestinationHost for compatibility.
Windows PowerShell
PS C:\> Compare‐VM –Name TestVM –DestinationHost TestDestinationHost
Example 2
Imports a virtual machine whose configuration is not compatible with the Hyper‐V host. Note the use of Compare‐VM to troubleshoot the import failure in the first
step.
Attempts import of a virtual machine; the attempt fails due to incompatibilities with the Hyper‐V host.
Windows PowerShell
PS C:\> Import‐VM ‐Path 'D:\vm1\Virtual Machines\53EAE599‐4D3B‐4923‐B173‐6AEA29CB7F42.XML'
Gets a compatibility report that describes the attempted import and lists the virtual machine’s incompatibilities with the Hyper‐V host.
Windows PowerShell
PS C:\> $report = Compare‐VM ‐Path 'D:\vm1\Virtual Machines\53EAE599‐4D3B‐4923‐B173‐6AEA29CB7F42.XML'
Displays the compatibility report, revealing that the virtual network adapter was connected to switch Production. The Hyper‐V host has no switch by that name.
Windows PowerShell
PS C:\> $report.Incompatibilities | Format‐Table ‐AutoSize
Disconnects the virtual network adapter.
Windows PowerShell
PS C:\> $report.Incompatibilities[0].Source | Disconnect‐VMNetworkAdapter
Generates a new compatibility report to determine if the virtual machine is compatible with the Hyper‐V host.
Windows PowerShell
PS C:\> Compare‐VM –CompatibilityReport $report
Displays the compatibility report.
Windows PowerShell
PS C:\> $report
Imports the virtual machine.
Windows PowerShell
PS C:\> import‐vm ‐CompatibilityReport $report
© 2015 Microsoft
Complete‐VMFailover
Windows Server 2012 R2 and Windows 8.1
Complete‐VMFailover
Completes a virtual machine’s failover process on the Replica server. Removes all recovery points on a failed over virtual machine.
Syntax
Parameter Set: VMName
Complete‐VMFailover [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐PassThru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Complete‐VMFailover [‐VM] <VirtualMachine[]> [‐PassThru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Complete‐VMFailover cmdlet completes a virtual machine’s failover process on the Replica server. The recovery point, on which the virtual machine is failed over,
is committed and all other recovery points are removed. Failover cannot be canceled after the recovery points are removed.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the failover process is to be completed. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐PassThru
Specifies that an object is to be passed through to the pipeline representing the virtual machine whose failover process is to be completed.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine whose failover process is to be completed.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose failover process is to be completed.
Aliases none
Required? true
Position? 1
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None by default; Microsoft.HyperV.PowerShell.VirtualMachine if –PassThru is specified.
Examples
Example 1
This command completes the failover process of a virtual machine named VM01, thereby deleting all other recovery points on the server.
Windows PowerShell
PS C:\> Complete‐VMFailover VM01
Example 2
This command completes the failover process of all virtual machines on the local host for which the failover process has been started.
Windows PowerShell
PS C:\> Complete‐VMFailover *
© 2015 Microsoft
Connect‐VMNetworkAdapter
Windows Server 2012 R2 and Windows 8.1
Connect‐VMNetworkAdapter
Connects a virtual network adapter to a virtual switch.
Syntax
Parameter Set: Name_SwitchName
Connect‐VMNetworkAdapter [‐VMName] <String[]> [[‐Name] <String[]> ] [‐SwitchName] <String> [‐ComputerName <String[]> ] [‐Passthru] [‐Confir
Parameter Set: Name_SwitchObject
Connect‐VMNetworkAdapter [‐VMName] <String[]> [[‐Name] <String[]> ] [‐VMSwitch] <VMSwitch> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParame
Parameter Set: Name_UseAutomaticConnection
Connect‐VMNetworkAdapter [‐VMName] <String[]> [[‐Name] <String[]> ] ‐UseAutomaticConnection [‐ComputerName <String[]> ] [‐Passthru] [‐Confi
Parameter Set: Object_SwitchName
Connect‐VMNetworkAdapter [‐VMNetworkAdapter] <VMNetworkAdapter[]> [‐SwitchName] <String> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParamete
Parameter Set: Object_SwitchObject
Connect‐VMNetworkAdapter [‐VMNetworkAdapter] <VMNetworkAdapter[]> [‐VMSwitch] <VMSwitch> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParamete
Parameter Set: Object_UseAutomaticConnection
Connect‐VMNetworkAdapter [‐VMNetworkAdapter] <VMNetworkAdapter[]> ‐UseAutomaticConnection [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParamet
Detailed Description
The Connect‐VMNetworkAdapter cmdlet connects a virtual network adapter to a virtual switch.
Parameters
‐ComputerName<String[]>
Specifies one or more virtual machine hosts on which the virtual network adapter is to be connected. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the virtual network adapter to be connected.
Aliases VMNetworkAdapterName
Required? false
Position? 2
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.VMNetworkAdapter object is to be passed through to the pipeline representing the virtual network adapter to be
connected.
Aliases none
Required? false
Position? named
‐SwitchName<String>
Specifies the name of the virtual switch to which the virtual network adapter is to be connected.
Aliases none
Required? true
Position? 2
‐UseAutomaticConnection
Specifies that the network adapter is to be connected to any virtual switch in the resource pool, rather than to a specific virtual switch.
Aliases none
Required? true
Position? named
‐VMName<String[]>
Specifies the name of the virtual machine in which the network adapter is to be connected.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapter[]>
Specifies the virtual network adapter to be connected.
Aliases none
Required? true
Position? 1
‐VMSwitch<VMSwitch>
Specifies the virtual switch to which the virtual network adapter is to be connected.
Aliases none
Required? true
Position? 2
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Connects a virtual network adapter named Internet in virtual machines Test1 and Test2 to a virtual switch InternetAccess.
Windows PowerShell
PS C:\> Connect‐VMNetworkAdapter ‐VMName Test1,Test2 ‐Name Internet ‐SwitchName InternetAccess
Example 2
Connects a virtual network adapter in virtual machine Test1 to virtual switch InternetAccess.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapter –VMName Test1 | Connect‐VMNetworkAdapter –SwitchName InternetAccess
Example 3
Connects a virtual network adapter in virtual machine Test1 to switch InternetAccess.
Windows PowerShell
PS C:\> Get‐VMSwitch InternetAccess | Connect‐VMNetworkAdapter ‐VMName Test1
© 2015 Microsoft
Connect‐VMSan
Windows Server 2012 R2 and Windows 8.1
Connect‐VMSan
Associates a host bus adapter with a virtual storage area network ﴾SAN﴿.
Syntax
Parameter Set: HbaObject
Connect‐VMSan [‐Name] <String> ‐HostBusAdapter <CimInstance[]> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: StringWwn
Connect‐VMSan [‐Name] <String> ‐WorldWideNodeName <String[]> ‐WorldWidePortName <String[]> [‐ComputerName <String[]> ] [‐Passthru] [‐Confir
Detailed Description
The Connect‐VMSan cmdlet associates a host bus adapter with a virtual storage area network ﴾SAN﴿.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts where the host bus adapter is to be associated with the virtual storage area network ﴾SAN﴿. NetBIOS names, IP addresses, and
fully‐qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
Aliases none
Required? true
Position? named
‐Name<String>
Specifies the name of the virtual storage area network ﴾SAN﴿ with which the host bus adapter is to be associated.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that a Microsoft.HyperV.Powershell.VMSan object is to be passed through to the pipeline representing the virtual storage area network ﴾SAN﴿ to be
associated with the host bus adapter.
Aliases none
Required? false
Position? named
‐WorldWideNodeName<String[]>
Specifies the world wide node name of the host bus adapter to be associated with the virtual storage area network ﴾SAN﴿.
Aliases none
Required? true
Position? named
Default Value none
‐WorldWidePortName<String[]>
The port world wide name of the host bus adapter to be associated with the virtual storage area network ﴾SAN﴿.
Aliases none
Required? true
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Associates the virtual storage area network ﴾SAN﴿ named Production with the host bus adapter having the specified world wide node name and world wide port name.
Windows PowerShell
PS C:\> Connect‐VMSan –Name Production ‐WorldWideNodeName C003FF0000FFFF00 –WorldWidePortName C003FF5778E50002
© 2015 Microsoft
Convert‐VHD
Windows Server 2012 R2 and Windows 8.1
Convert‐VHD
Converts the format, version type, and block size of a virtual hard disk file.
Syntax
Parameter Set: Default
Convert‐VHD [‐Path] <String> [‐DestinationPath] <String> [‐AsJob] [‐BlockSizeBytes <UInt32> ] [‐ComputerName <String[]> ] [‐DeleteSource] [
Detailed Description
The Convert‐VHD cmdlet converts a virtual hard disk file by copying the data from a source virtual hard disk file to a new virtual hard disk file of a specified format and
version type. The format is determined by the file extension of the specified files, either .vhdx or .vhd. Conversion is an offline operation; the virtual hard disk must not
be attached when the operation is started.
Parameters
‐AsJob
Runs the operation as a background job.
Aliases none
Required? false
Position? named
‐BlockSizeBytes<UInt32>
Specifies the block size, in bytes, of the virtual hard disk after conversion.
Aliases none
Required? false
Position? named
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the virtual hard disk is to be converted. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐DeleteSource
Specifies that the source virtual hard disk is to be deleted after the conversion.
Aliases none
Required? false
Position? named
‐DestinationPath<String>
Specifies the path to the converted virtual hard disk file.
Aliases none
Required? true
Position? 2
‐ParentPath<String>
Specifies the parent path for the destination‐differencing virtual hard disk file.
Aliases none
Required? false
Position? named
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the converted virtual hard disk.
Aliases none
Required? false
Position? named
‐Path<String>
Specifies the path to the virtual hard disk file to be converted. If a file name or relative path is specified, the path of the converted hard disk path is calculated relative to
the current working directory
Aliases FullName
Required? true
Position? 1
‐VHDType<VhdType>
Specifies the type of the converted virtual hard disk. Allowed values are Fixed, Dynamic, and Differencing. The default is determined by the type of source virtual hard
disk.
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example converts a source VHD to a destination VHDX. Because the format is determined by the file extension and the default type is determined by the source
virtual hard disk when no type is specified, the destination virtual hard disk will be a VHDX‐format disk of the same type as the source virtual hard disk.
Windows PowerShell
PS C:\> Convert‐VHD –Path c:\test\testvhd.vhd –DestinationPath c:\test\testvhdx.vhdx
Example 2
This example converts a source differencing disk of VHDX format to a destination differencing disk of VHD format that is connected to an existing parent disk.
Windows PowerShell
PS C:\> Convert‐VHD –Path c:\test\child1vhdx.vhdx –DestinationPath c:\test\child1vhd.vhd –VHDType Differencing –ParentPath c:\test\parentvh
© 2015 Microsoft
Copy‐VMFile
Windows Server 2012 R2 and Windows 8.1
Copy‐VMFile
Copies a file to a virtual machine.
Syntax
Parameter Set: Name
Copy‐VMFile [‐Name] <String[]> [‐SourcePath] <String> [‐DestinationPath] <String> ‐FileSource <CopyFileSourceType> [‐AsJob] [‐ComputerName
Parameter Set: VMObject
Copy‐VMFile [‐VM] <VirtualMachine[]> [‐SourcePath] <String> [‐DestinationPath] <String> ‐FileSource <CopyFileSourceType> [‐AsJob] [‐CreateF
Detailed Description
The Copy‐VMFile cmdlet copies a file to a virtual machine.
Parameters
‐AsJob
Aliases none
Required? false
Position? named
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet copies the file to the hosts you specify.
Aliases none
Required? false
Position? named
Default Value .
Accept Pipeline Input? false
‐CreateFullPath
Indicates that when the cmdlet copies a file, it creates folders if the folder does not already exist.
Aliases none
Required? false
Position? named
‐DestinationPath<String>
Specifies a path. The cmdlet copies the file to the destination path.
Aliases none
Required? true
Position? 3
‐FileSource<CopyFileSourceType>
Specifies the type of a file source.
Aliases none
Required? true
Position? named
‐Force
Forces the command to run without asking for user confirmation.
Aliases none
Required? false
Position? named
‐Name<String[]>
Specifies an array of virtual machine objects by name. The cmdlet copies files to the virtual machines you specify.
Aliases VMName
Required? true
Position? 1
‐SourcePath<String>
Specifies a path. The cmdlet copies the file from the source path.
Aliases none
Required? true
Position? 2
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet copies files to the virtual machines you specify. To obtain a virtual machine object, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example copies the file “test.txt” from the host operating system into the guest operating system of the virtual machine “Test VM”. It will create the directory
“C:\Temp” inside the guest operating system if it does not exist already.
Windows PowerShell
PS C:\> Copy‐VMFile "Test VM" ‐SourcePath "D:\Test.txt" ‐DestinationPath "C:\Temp\Test.txt" ‐CreateFullPath ‐FileSource Host
© 2015 Microsoft
Debug‐VM
Windows Server 2012 R2 and Windows 8.1
Debug‐VM
Debugs a virtual machine.
Syntax
Parameter Set: Name
Debug‐VM [‐Name] <String[]> [‐AsJob] [‐ComputerName <String[]> ] [‐Force] [‐InjectNonMaskableInterrupt] [‐Passthru] [‐Confirm] [‐WhatIf] [
Parameter Set: VMObject
Debug‐VM [‐VM] <VirtualMachine[]> [‐AsJob] [‐Force] [‐InjectNonMaskableInterrupt] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Debug‐VM cmdlet debugs a virtual machine.
Parameters
‐AsJob
Aliases none
Required? false
Position? named
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet debugs the virtual machines on the hosts you specify.
Aliases none
Required? false
Position? named
Default Value .
‐Force
Forces the command to run without asking for user confirmation.
Aliases none
Required? false
Position? named
Aliases none
Required? false
Position? named
‐Name<String[]>
Specifies an array of names of virtual machines to be debugged.
Aliases VMName
Required? true
Position? 1
‐Passthru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects that are to be debugged. To obtain virtual machine objects, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
Default Value none
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example injects a non‐maskable interrupt into the virtual machine named “VM to Debug”. A kernel debugger should be connected to the guest operating system
before attempting to do this.
Windows PowerShell
PS C:\> debug‐vm "VM to Debug" ‐InjectNonMaskableInterrupt ‐Force
© 2015 Microsoft
Disable‐VMEventing
Windows Server 2012 R2 and Windows 8.1
Disable‐VMEventing
Disables virtual machine eventing.
Syntax
Parameter Set: Default
Disable‐VMEventing [‐ComputerName <String[]> ] [‐Force] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Disable‐VMEventing cmdlet disables virtual machine eventing on a Hyper‐V host or hosts. Virtual machine eventing keeps Hyper‐V PowerShell objects updated
without polling the virtual machine host. Virtual machine eventing is enabled by default.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which virtual machine eventing is to be disabled. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Force
Specifies that the confirmation prompt is to be suppressed. ﴾This is useful in scripting the cmdlet.﴿
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Disables virtual machine eventing, suppressing the confirmation prompt.
Windows PowerShell
PS C:\> Disable‐VMEventing ‐Force
© 2015 Microsoft
Disable‐VMIntegrationService
Windows Server 2012 R2 and Windows 8.1
Disable‐VMIntegrationService
Disables an integration service on a virtual machine.
Syntax
Parameter Set: VMName
Disable‐VMIntegrationService [‐Name] <String[]> [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <Common
Parameter Set: VMIntegrationService
Disable‐VMIntegrationService [‐VMIntegrationService] <VMIntegrationComponent[]> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Disable‐VMIntegrationService [‐Name] <String[]> [‐VM] <VirtualMachine[]> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Disable‐VMIntegrationService cmdlet disables an integration service on a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the integration service on a virtual machine is to be disabled. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the integration service to be disabled.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.IntegrationService object is to be passed through to the pipeline representing the integration service to be disabled.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine on which the integration service is to be disabled.
Aliases none
Required? true
Position? 2
‐VMIntegrationService<VMIntegrationComponent[]>
Specifies the integration service to be disabled.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine on which the integration service is to be disabled.
Aliases none
Required? true
Position? 2
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example disables the Shutdown and VSS integration services on virtual machine Test1.
Windows PowerShell
PS C:\> Disable‐VMIntegrationService ‐Name Shutdown,VSS ‐VMName Test1
© 2015 Microsoft
Disable‐VMMigration
Windows Server 2012 R2 and Windows 8.1
Disable‐VMMigration
Disables migration on one or more virtual machine hosts.
Syntax
Parameter Set: Default
Disable‐VMMigration [[‐ComputerName] <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Disable‐VMMigration cmdlet disables migration on one or more virtual machine hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which migration is to be disabled. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The default is
the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? 1
Default Value .
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.Host object is to be passed through to the pipeline representing each virtual machine host on which migration is
disabled.
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Disables live migration on the local Hyper‐V host.
Windows PowerShell
PS C:\> Disable‐VMMigration
© 2015 Microsoft
Disable‐VMRemoteFXPhysicalVideoAdapter
Windows Server 2012 R2 and Windows 8.1
Disable‐VMRemoteFXPhysicalVideoAdapter
Disables one or more RemoteFX physical video adapters from use with RemoteFX‐enabled virtual machines.
Syntax
Parameter Set: GPUByName
Disable‐VMRemoteFXPhysicalVideoAdapter [‐Name] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [ <CommonParameters>]
Parameter Set: GPUByObject
Disable‐VMRemoteFXPhysicalVideoAdapter [‐GPU] <VMRemoteFXPhysicalVideoAdapter[]> [‐Passthru] [ <CommonParameters>]
Detailed Description
The Disable‐VMRemoteFXPhysicalVideoAdapter disables one or more RemoteFX physical video adapter from use with RemoteFX‐enabled virtual machines.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the RemoteFX physical video adapters are to be disabled. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐GPU<VMRemoteFXPhysicalVideoAdapter[]>
Specifies one or more RemoteFX physical video adapters to disable.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that Microsoft.HyperV.PowerShell.VMRemoteFXPhysicalVideoAdapter objects are to be passed to the pipeline representing the RemoteFX physical video
adapters to be disabled.
Aliases none
Required? false
Position? named
‐Name<String[]>
Specifies an array of names of adapters. The cmdlet disables the RemoteFX physical video adapters that you specify.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.VMRemoteFXPhysicalVideoAdapter[]
System.String[]
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
This example disables all RemoteFX physical video adapters that include the string “Nvidia” in their names.
Windows PowerShell
PS C:\> Disable‐VMRemoteFXPhysicalVideoAdapter –Name *Nvidia*
Example 2
This example disables all RemoteFX physical video adapters that include the string “Nvidia” in their names.
Windows PowerShell
PS C:\> Get‐VMRemoteFXPhysicalVideoAdapter –Name *Nvidia* | Disable‐VMRemotePhysicalVideoAdapter
© 2015 Microsoft
Disable‐VMResourceMetering
Windows Server 2012 R2 and Windows 8.1
Disable‐VMResourceMetering
Disables collection of resource utilization data for a virtual machine or resource pool.
Syntax
Parameter Set: ResourcePool
Disable‐VMResourceMetering [‐ResourcePoolName] <String> [[‐ResourcePoolType] <VMResourcePoolType> ] [‐ComputerName <String[]> ] [ <CommonPa
Parameter Set: VMName
Disable‐VMResourceMetering [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Disable‐VMResourceMetering [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Detailed Description
The Disable‐VMResourceMetering cmdlet disables collection of resource utilization data for a virtual machine or resource pool.
Calling this cmdlet stops collection of data and deletes data collected up to the point of the call.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which resource utilization data collection is to be disabled. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐ResourcePoolName<String>
Specifies the friendly name of the resource pool on which resource utilization data collection is to be disabled.
Aliases Name
Required? true
Position? 1
‐ResourcePoolType<VMResourcePoolType>
Specifies the resource type of the resource pool on which resource utilization data collection is to be disabled.
Aliases none
Required? false
Position? 2
Default Value none
‐VM<VirtualMachine[]>
Specifies the virtual machine on which resource utilization data collection is to be disabled.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the friendly name of the virtual machine on which resource utilization data collection is to be disabled.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.VirtualMachine[]
Microsoft.HyperV.PowerShell.VMResourcePoolType
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Disables collection of resource utilization data on a virtual machine named TestVM.
Windows PowerShell
PS C:\> Disable‐VMResourceMetering –VMName TestVM
Example 2
Disables collection of resource utilization data on a set of virtual machines whose names begin with the string Test.
Windows PowerShell
PS C:\> Get‐VM Test* | Disable‐VMResourceMetering
Example 3
Disables collection of resource utilization data on a resource pool named TestResourcePool of type Memory.
Windows PowerShell
PS C:\> Disable‐VMResourceMetering –ResourcePoolName TestResourcePool –ResourcePoolType Memory
Related topics
Measure‐VM
Measure‐VMResourcePool
Enable‐VMResourceMetering
© 2015 Microsoft
Disable‐VMSwitchExtension
Windows Server 2012 R2 and Windows 8.1
Disable‐VMSwitchExtension
Disables one or more extensions on one or more virtual switches.
Syntax
Parameter Set: ExtensionName
Disable‐VMSwitchExtension [‐Name] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: ExtensionNameSwitchName
Disable‐VMSwitchExtension [‐Name] <String[]> [‐VMSwitchName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: ExtensionNameSwitchObject
Disable‐VMSwitchExtension [‐Name] <String[]> [‐VMSwitch] <VMSwitch[]> [ <CommonParameters>]
Parameter Set: ExtensionObject
Disable‐VMSwitchExtension [‐VMSwitchExtension] <VMSwitchExtension[]> [ <CommonParameters>]
Detailed Description
The Disable‐VMSwitchExtension cmdlet disables one or more extensions on one or more virtual switches. You can run Get‐VMSystemSwitchExtension to enumerate
the virtual switch extensions installed on the system.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the extension is to be disabled. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases PSComputerName
Required? false
Position? named
Default Value .
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch on which the extension is to be disabled.
Aliases none
Required? true
Position? 2
‐VMSwitchExtension<VMSwitchExtension[]>
Specifies the extension to be disabled.
Aliases none
Required? true
Position? 1
‐VMSwitchName<String[]>
Specifies the name of the switch on which the extension is to be disabled.
Aliases none
Required? true
Position? 2
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.NetworkExtension
Examples
Example 1
Disables WFP ﴾“Microsoft Windows Filtering Platform”﴿ on virtual switch Internal Switch.
Windows PowerShell
PS C:\> Disable‐VMSwitchExtension –VMSwitchName "Internal Switch" –Name "Microsoft Windows Filtering Platform"
© 2015 Microsoft
Disconnect‐VMNetworkAdapter
Windows Server 2012 R2 and Windows 8.1
Disconnect‐VMNetworkAdapter
Disconnects a virtual network adapter from a virtual switch or Ethernet resource pool.
Syntax
Parameter Set: Name
Disconnect‐VMNetworkAdapter [‐VMName] <String[]> [[‐Name] <String[]> ] [‐ComputerName <String[]> ] [‐Passthru] [ <CommonParameters>]
Parameter Set: Obj
Disconnect‐VMNetworkAdapter [‐VMNetworkAdapter] <VMNetworkAdapter[]> [‐Passthru] [ <CommonParameters>]
Detailed Description
The Disconnect‐VMNetworkAdapter cmdlet disconnects a virtual network adapter from a virtual switch or Ethernet resource pool.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a virtual network adapter is to be disconnected. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the virtual network adapter to be disconnected.
Aliases none
Required? false
Position? 2
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.VMNetworkAdapter object is to be passed through to the pipeline representing the virtual network adapter to be
disconnected.
Aliases none
Required? false
Position? named
‐VMName<String[]>
Specifies the name of the virtual machine in which the virtual network adapter is to be disconnected.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapter[]>
Specifies the virtual network adapter to be disconnected.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Disconnects virtual network adapter Test1.
Windows PowerShell
PS C:\> Disconnect‐VMNetworkAdapter ‐VMNetworkAdapter Test1
Example 2
Disconnects all virtual network adapters whose SwitchName is InternetAccess in all virtual machines on the local Hyper‐V server.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapter ‐VMName * | Where‐Object {$_.SwitchName ‐eq 'InternetAccess'} | Disconnect‐VMNetworkAdapter
© 2015 Microsoft
Disconnect‐VMSan
Windows Server 2012 R2 and Windows 8.1
Disconnect‐VMSan
Removes a host bus adapter from a virtual storage area network ﴾SAN﴿.
Syntax
Parameter Set: HbaObject
Disconnect‐VMSan [‐Name] <String> ‐HostBusAdapter <CimInstance[]> [‐Passthru] [ <CommonParameters>]
Parameter Set: StringWwn
Disconnect‐VMSan [‐Name] <String> ‐WorldWideNodeName <String[]> ‐WorldWidePortName <String[]> [‐ComputerName <String[]> ] [‐Passthru] [ <Co
Detailed Description
The Disconnect‐VMSan cmdlet removes a host bus adapter from a virtual storage area network ﴾SAN﴿.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a host bus adapter is to be removed from a virtual storage area network ﴾SAN﴿. NetBIOS names, IP addresses, and fully‐
qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐HostBusAdapter<CimInstance[]>
Specifies the host bus adapter to be removed from the virtual storage area network ﴾SAN﴿.
Aliases none
Required? true
Position? named
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the virtual storage area network ﴾SAN﴿ from which the host bus adapter is to be removed.
Aliases none
Required? false
Position? named
‐WorldWideNodeName<String[]>
The world wide node name of the host bus adapter to be removed from the virtual storage area network ﴾SAN﴿.
Aliases none
Required? true
Position? named
‐WorldWidePortName<String[]>
The world wide port name of the host bus adapter to be removed from the virtual storage area network ﴾SAN﴿.
Aliases none
Required? true
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Removes the host bus adapter having the specified world wide node name and world wide port name from the virtual SAN named Production on the local Hyper‐V
host.
Windows PowerShell
PS C:\> Disconnect‐VMSan –Name Production ‐WorldWideNodeName C003FF0000FFFF00 –WorldWidePortName C003FF5778E50002
© 2015 Microsoft
Dismount‐VHD
Windows Server 2012 R2 and Windows 8.1
Dismount‐VHD
Dismounts a virtual hard disk.
Syntax
Parameter Set: Path
Dismount‐VHD [‐Path] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: Disk
Dismount‐VHD [‐DiskNumber] <UInt32> [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Dismount‐VHD cmdlet dismounts a virtual hard disk.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a virtual hard disk is to be dismounted. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐DiskNumber<UInt32>
Specifies the disk number of the virtual hard disk to be dismounted.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the virtual hard disk to be dismounted.
Aliases none
Required? false
Position? named
‐Path<String[]>
Specifies one or more virtual hard disk files for which the corresponding virtual hard disks are to be dismounted.
Aliases none
Required? true
Position? 1
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Dismounts an attached virtual hard disk where the path to the virtual hard disk file path is c:\test\testvhdx.vhdx.
Windows PowerShell
PS C:\> Dismount‐VHD –Path c:\test\testvhdx.vhdx
Example 2
Dismounts the attached virtual hard disk image with disk number 6.
Windows PowerShell
PS C:\> Dismount‐VHD –DiskNumber 6
© 2015 Microsoft
Enable‐VMEventing
Windows Server 2012 R2 and Windows 8.1
Enable‐VMEventing
Enables virtual machine eventing.
Syntax
Parameter Set: Default
Enable‐VMEventing [‐ComputerName <String[]> ] [‐Force] [ <CommonParameters>]
Detailed Description
The Enable‐VMEventing cmdlet enables virtual machine eventing. Virtual machine eventing keeps Hyper‐V PowerShell objects updated without polling the virtual
machine host. Virtual machine eventing is enabled by default.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which virtual machine eventing is to be enabled. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Force
Specifies that the confirmation prompt is to be suppressed. ﴾This is useful in scripting the cmdlet.﴿
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Enables virtual machine eventing, suppressing the confirmation prompt.
Windows PowerShell
PS C:\> Enable‐VMEventing ‐Force
© 2015 Microsoft
Enable‐VMIntegrationService
Windows Server 2012 R2 and Windows 8.1
Enable‐VMIntegrationService
Enables an integration service on a virtual machine.
Syntax
Parameter Set: VMName
Enable‐VMIntegrationService [‐Name] <String[]> [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonP
Parameter Set: VMIntegrationService
Enable‐VMIntegrationService [‐VMIntegrationService] <VMIntegrationComponent[]> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Enable‐VMIntegrationService [‐Name] <String[]> [‐VM] <VirtualMachine[]> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Enable‐VMIntegrationService cmdlet enables an integration service on a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which an integration service is to be enabled. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the integration service to be enabled.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.IntegrationService object is to be passed through to the pipeline representing the integration service to be enabled.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine on which the integration service is to be enabled.
Aliases none
Required? true
Position? 2
‐VMIntegrationService<VMIntegrationComponent[]>
Specifies the integration service to be enabled.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine on which the integration service is to be enabled.
Aliases none
Required? true
Position? 2
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Enables integration services Shutdown and VSS on virtual machine Test1.
Windows PowerShell
PS C:\> Enable‐VMIntegrationService ‐Name Shutdown,VSS ‐VMName Test1
Example 2
Enables integration services Shutdown and VSS on virtual machine Test1.
Windows PowerShell
PS C:\> Get‐VMIntegrationService Shutdown,Vss ‐VMName Test1 | Enable‐VMIntegrationService
Example 3
Enables integration services Shutdown and VSS on virtual machine Test1.
Windows PowerShell
PS C:\> Get‐VM Test1 | Enable‐VMIntegrationService Shutdown,VSS
© 2015 Microsoft
Enable‐VMMigration
Windows Server 2012 R2 and Windows 8.1
Enable‐VMMigration
Enables migration on one or more virtual machine hosts.
Syntax
Parameter Set: Default
Enable‐VMMigration [[‐ComputerName] <String[]> ] [‐Passthru] [ <CommonParameters>]
Detailed Description
The Enable‐VMMigration cmdlet enables migration on one or more virtual machine hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which migration is to be enabled.
Aliases none
Required? false
Position? 1
Default Value .
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.Host object is to be passed through to the pipeline representing each virtual machine host on which migration is to be
enabled.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Enables live migration on the local Hyper‐V host.
Windows PowerShell
PS C:\> Enable‐VMMigration
© 2015 Microsoft
Enable‐VMRemoteFXPhysicalVideoAdapter
Windows Server 2012 R2 and Windows 8.1
Enable‐VMRemoteFXPhysicalVideoAdapter
Enables one or more RemoteFX physical video adapters for use with RemoteFX‐enabled virtual machines.
Syntax
Parameter Set: GPUByName
Enable‐VMRemoteFXPhysicalVideoAdapter [‐Name] <String[]> [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: GPUByObject
Enable‐VMRemoteFXPhysicalVideoAdapter [‐GPU] <VMRemoteFXPhysicalVideoAdapter[]> [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Detailed Description
The Enable‐VMRemoteFXPhysicalVideoAdapter cmdlet enables one or more RemoteFX physical video adapters to be used with RemoteFX‐enabled virtual machines.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the RemoteFX physical video adapters are to be enabled. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐GPU<VMRemoteFXPhysicalVideoAdapter[]>
Specifies the RemoteFX physical video adapters to be enabled.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that one or more Microsoft.HyperV.PowerShell.VMRemoteFXPhysicalVideoAdapter objects are to be passed through to the pipeline representing the
RemoteFX physical video adapters to be enabled.
Aliases none
Required? false
Position? named
‐Name<String[]>
Specifies an array of names of adapters. The cmdlet enables the RemoteFX physical video adapters that you specify.
Aliases none
Required? true
Position? 1
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.VMRemoteFXPhysicalVideoAdapter[]
System.String[]
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Code Example Title
Enables all RemoteFX physical video adapters which include the sequence “Nvidia” in their name.
Windows PowerShell
PS C:\> Get‐VMRemoteFXPhysicalVideoAdapter –Name *Nvidia* | Enable‐VMRemoteFXPhysicalVideoAdapter
© 2015 Microsoft
Enable‐VMReplication
Windows Server 2012 R2 and Windows 8.1
Enable‐VMReplication
Enables replication of a virtual machine.
Syntax
Parameter Set: VMName
Enable‐VMReplication [‐VMName] <String[]> [‐ReplicaServerName] <String> [‐ReplicaServerPort] <Int32> [‐AuthenticationType] <ReplicationAuth
Parameter Set: VMName_AsReplica
Enable‐VMReplication [‐VMName] <String[]> [‐AllowedPrimaryServer <String> ] [‐AsJob] [‐AsReplica] [‐ComputerName <String[]> ] [‐PassThru] [
Parameter Set: VMObject
Enable‐VMReplication [‐VM] <VirtualMachine[]> [‐ReplicaServerName] <String> [‐ReplicaServerPort] <Int32> [‐AuthenticationType] <Replication
Parameter Set: VMObject_AsReplica
Enable‐VMReplication [‐VM] <VirtualMachine[]> [‐AllowedPrimaryServer <String> ] [‐AsJob] [‐AsReplica] [‐PassThru] [‐Confirm] [‐WhatIf] [ <C
Detailed Description
The Enable‐VMReplication cmdlet enables replication of a virtual machine to a specified Replica server.
Parameters
‐AllowedPrimaryServer<String>
When you use the AsReplica parameter to specify a virtual machine as a replica virtual machine, this parameter determines which primary servers can send replication to
the replica virtual machine. Replication is accepted only from the server specified in the chosen authentication entry, or any other authentication entry that has the same
trust group.
Aliases AllowedPS
Required? false
Position? named
‐AsJob
Runs the cmdlet as a background job.
Aliases none
Required? false
Position? named
‐AsReplica
Specifies that the virtual machine is a replica virtual machine, enabling it to be used as the source for the initial replication of the primary virtual machine.
Aliases none
Required? false
Position? named
‐AuthenticationType<ReplicationAuthenticationType>
Specifies the authentication type to use for virtual machine replication, either “Kerberos” or “Certificate”. The specified Replica server must support the chosen
authentication type. Run the Get‐VMReplicationServer cmdlet to verify the authentication configured for the specified Replica server, or contact the administrator of the
specified Replica server.
Aliases AuthType
Required? true
Position? 4
‐AutoResynchronizeEnabled<Boolean>
Enables replicating virtual machines that require resynchronization to be resynchronized automatically. ﴾For example, a virtual machine requires resynchronization if the
primary server shuts down abruptly﴿. Resynchronization requires significant storage and processing resources. We recommended scheduling resynchronization during
off‐peak hours to reduce the impact to the host and other virtual machines running on the host. Use the AutoResynchronizeIntervalStart and
AutoResynchronizeIntervalEnd parameters to specify an off‐peak time to start the automatic resynchronization.
Aliases AutoResync
Required? false
Position? named
‐AutoResynchronizeIntervalEnd<TimeSpan>
Specifies the end of the time period in which you want resynchronization to start automatically.
Aliases AutoResyncEnd
Required? false
Position? named
‐AutoResynchronizeIntervalStart<TimeSpan>
Specifies the start of the time period in which you want resynchronization to start automatically.
Aliases AutoResyncStart
Required? false
Position? named
‐BypassProxyServer<Boolean>
Specifies whether to bypass a proxy server while replicating data to the Replica server.
Aliases none
Required? false
Position? named
‐CertificateThumbprint<String>
Specifies the certificate to use for mutual authentication of the replication data. This parameter is required only when “Certificate” is specified as the type of
authentication. Specify the thumbprint of a valid computer certificate from the Personal store.
‐‐ The certificate must have all of the following properties to be valid:
‐‐ It must include both client and server authentication extensions for extended key usage ﴾EKU﴿, and an associated private key.
‐‐ The requirement for the subject common name ﴾CN﴿ differs depending on whether the virtual machine belongs to a cluster. For virtual machines that do not belong
to a cluster, the subject common name ﴾CN﴿ must be equal to, or subject alternative name ﴾DNS Name﴿ should contain, the FQDN of the host. For virtual machines that
belong to a cluster, the subject common name ﴾CN﴿ must be equal to, or subject alternative name ﴾DNS Name﴿ must contain, the and fully‐qualified domain name
﴾FQDN﴿ of the Hyper‐V Replica Broker.
To display a list of certificates in the computer’s My store and the thumbprint of each certificate, type the following:
PS C:\> cd cert:\LocalMachine\My
PS C:\> dir | format‐list
Aliases Thumbprint,Cert
Required? false
Position? named
‐CompressionEnabled<Boolean>
Specifies whether to compress replication data for this virtual machine when it is sent over the network.
Aliases none
Required? false
Position? named
Aliases none
Required? false
Position? named
‐EnableWriteOrderPreservationAcrossDisks<Boolean>
Determines whether all virtual hard disks selected for replication are replicated to the same point in time. This is useful if the virtual machine runs an application that
saves data across virtual hard disks ﴾for example, one virtual hard disk dedicated for application data, and another virtual hard disk dedicated for application log files﴿.
Aliases none
Required? false
Position? named
‐ExcludedVhd<HardDiskDrive[]>
Specifies one or more virtual hard disks to exclude from replication ﴾for example, a virtual hard disk dedicated for the paging file﴿. Be careful not to exclude virtual hard
disks that are critical to the virtual machine’s ability to start up, such as the virtual hard disk that stores the guest operating system. Excluding a critical disk could
prevent the replica virtual machine from starting up properly.
Aliases none
Required? false
Position? named
‐ExcludedVhdPath<String[]>
Specifies the fully qualified path names to the virtual hard disks to exclude from replication.
Aliases none
Required? false
Position? named
‐PassThru
Specifies that a VMReplication object is to be passed through to the pipeline representing the replication.
Aliases none
Required? false
Position? named
‐RecoveryHistory<Int32>
Specifies whether to store additional recovery points on the replica virtual machine. Storing more than the most recent recovery point of the primary virtual machine
allows you to recover to an earlier point in time. However, storing additional recovery points requires more storage and processing resources. You can configure as
many as 24 recovery points to be stored.
Aliases RecHist
Required? false
Position? named
‐ReplicaServerName<String>
Specifies the name of the Replica server to which this virtual machine will be replicated.
Aliases ReplicaServer
Required? true
Position? 2
‐ReplicaServerPort<Int32>
Specifies the port on the Replica server to use for replication traffic. Make sure you specify a port that is configured on the Replica server to support the same
authentication type you specify using the AuthenticationType parameter in this cmdlet. Run the Get‐VMReplicationServer cmdlet on the Replica server to check the
configuration of the port, or contact the administrator of the specified Replica server.
Aliases ReplicaPort
Required? true
Position? 3
‐ReplicateHostKvpItems<Boolean>
Specifies whether to replicate host‐only key value pairs ﴾KVP﴿ for this virtual machine.
Aliases none
Required? false
Position? named
‐ReplicationFrequencySec<Int32>
Specifies the frequency, in seconds, at which Hyper‐V replicates changes to the Replica server.
Aliases RepFreq
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine you want to configure for replication.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine you want to configure for replication.
Aliases Name
Required? true
Position? 1
‐VSSSnapshotFrequencyHour<Int32>
Specifies the frequency, in hours, at which Volume Shadow Copy Service ﴾VSS﴿ performs a snapshot backup of the virtual machines. Specify this parameter only if
application‐consistent replication is enabled for the virtual machines and the value you set for the RecoveryHistory parameter is not zero. The cmdlet sets a value of
zero for this parameter if application‐consistent replication is disabled. Do not specify this parameter if you are extending replication from the Replica virtual machine.
Aliases VSSFreq
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None.
Outputs
The output type is the type of the objects that the cmdlet emits.
None.
Examples
Example 1
This example configures replication for a virtual machine named VM01 on the local Hyper‐V host and directs replication traffic to port 80 on a Replica server named
server01.domain01.contoso.com, using Kerberos as the type of authentication.
Windows PowerShell
PS C:\> Enable‐VMReplication VM01 server01.domain01.contoso.com 80 Kerberos
Example 2
This example configures replication for all virtual machines on the local Hyper‐V host to replica server and directs replication traffic to port 80 on a Replica server named
server01.domain01.contoso.com, using Kerberos as the type of authentication.
Windows PowerShell
PS C:\> Enable‐VMReplication * server01.domain01.contoso.com 80 Kerberos
Example 3
This example configures a virtual machine VM02 as a replica virtual machine and allows replication of the primary virtual machine from all primary servers that belong
to a domain named domain01.contoso.com.
Windows PowerShell
PS C:\> Enable‐VMReplication VM01 –AsReplica –AllowedPrimaryServer *.domain01.contoso.com
© 2015 Microsoft
Enable‐VMResourceMetering
Windows Server 2012 R2 and Windows 8.1
Enable‐VMResourceMetering
Collects resource utilization data for a virtual machine or resource pool.
Syntax
Parameter Set: ResourcePool
Enable‐VMResourceMetering [‐ResourcePoolName] <String> [[‐ResourcePoolType] <VMResourcePoolType> ] [‐ComputerName <String[]> ] [ <CommonPar
Parameter Set: VMName
Enable‐VMResourceMetering [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Enable‐VMResourceMetering [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Detailed Description
The Enable‐VMResourceMetering cmdlet starts collecting resource utilization data for a virtual machine or resource pool.
You can use the Measure‐VM or Measure‐VMResourcePool cmdlet to obtain this data.
If resource metering is enabled but no NetworkAdapterAcls are configured, Hyper‐V configures them to measure total network traffic. To measure network traffic
through an IP range, configure the NetworkAdapterAcls for the IP range before calling this cmdlet. ﴾See Add‐VMNetworkAdapterAcl for more information.﴿
Parameters
‐ComputerName<String[]>
Specifies the virtual machine host or hosts on which resource utilization data collection is to be enabled. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐ResourcePoolName<String>
Specifies the friendly name of the resource pool for which you want to collect resource utilization data.
Aliases Name
Required? true
Position? 1
Aliases none
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine for which you want to collect resource utilization data.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the friendly name of the virtual machine for which you want to collect resource utilization data.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.VirtualMachine[]
Microsoft.HyperV.PowerShell.VMResourcePoolType
Outputs
The output type is the type of the objects that the cmdlet emits.
None
Examples
Example 1
This example starts collecting resource utilization data on a virtual machine named TestVM.
Windows PowerShell
PS C:\> Enable‐VMResourceMetering –VMName TestVM
Example 2
This example starts collecting resource utilization data on a resource pool named TestResourcePool. ﴾You can determine whether resource metering is enabled for a
resource pool by querying its ResourceMeteringEnabled property.﴿
Windows PowerShell
PS C:\> Get‐VM TestVM | Enable‐VMResourceMetering
PS C:\> Get‐VM TestVM | Format‐List Name,ResourceMeteringEnabled
Example 3
This example uses two commands that show resource metering being enabled and then obtain the data. The first command starts collecting resource utilization data for
a memory resource pool named TestResourcePool. ﴾You can determine whether resource metering is enabled for a resource pool by querying its
ResourceMeteringEnabled property.﴿ The second command retrieves the data in and formats it as a list.
Windows PowerShell
PS C:\> Enable‐VMResourceMetering –ResourcePoolName TestResourcePool –ResourcePoolType Memory
PS C:\> Get‐VMResourcePool ‐Name TestResourcePool –ResourcePoolType Memory | Format‐List Name,ResourceMeteringEnabled
Example 4
This example begins collecting resource utilization data on multiple resource pools with the name TestResourcePool.
Windows PowerShell
PS C:\> Enable‐VMResourceMetering –Name TestResourcePool –ResourcePoolType @("Processor","VHD","Ethernet","Memory")
Related topics
Measure‐VM
Measure‐VMResourcePool
Disable‐VMResourceMetering
© 2015 Microsoft
Enable‐VMSwitchExtension
Windows Server 2012 R2 and Windows 8.1
Enable‐VMSwitchExtension
Enables one or more extensions on one or more switches.
Syntax
Parameter Set: ExtensionName
Enable‐VMSwitchExtension [‐Name] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: ExtensionNameSwitchName
Enable‐VMSwitchExtension [‐Name] <String[]> [‐VMSwitchName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: ExtensionNameSwitchObject
Enable‐VMSwitchExtension [‐Name] <String[]> [‐VMSwitch] <VMSwitch[]> [ <CommonParameters>]
Parameter Set: ExtensionObject
Enable‐VMSwitchExtension [‐VMSwitchExtension] <VMSwitchExtension[]> [ <CommonParameters>]
Detailed Description
The Enable‐VMSwitchExtension cmdlet enables one or more extensions on one or more switches. You can use the Get‐VMSystemSwitchExtension cmdlet to
enumerate the virtual switch extensions installed on the system.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which an extension is to be enabled. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The default
is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases PSComputerName
Required? false
Position? named
Default Value .
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch on which the extension is to be enabled.
Aliases none
Required? true
Position? 2
‐VMSwitchExtension<VMSwitchExtension[]>
Specifies the extension to be enabled.
Aliases none
Required? true
Position? 1
‐VMSwitchName<String[]>
Specifies the name of the switch on which the extension is to be enabled.
Aliases none
Required? true
Position? 2
‐Name<String[]>
Specifies the name of the network extension to be enabled.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.NetworkExtension
Examples
Example 1
Enables WFP ﴾“Microsoft Windows Filtering Platform”﴿ on a virtual switch named External.
Windows PowerShell
PS C:\> Enable‐VMSwitchExtension –VMSwitchName External –Name "Microsoft Windows Filtering Platform"
© 2015 Microsoft
Export‐VM
Windows Server 2012 R2 and Windows 8.1
Export‐VM
Exports a virtual machine to disk.
Syntax
Parameter Set: Name
Export‐VM [‐Name] <String[]> [‐Path] <String> [‐AsJob] [‐ComputerName <String[]> ] [‐Passthru] [ <CommonParameters>]
Parameter Set: VMObject
Export‐VM [‐VM] <VirtualMachine[]> [‐Path] <String> [‐AsJob] [‐Passthru] [ <CommonParameters>]
Detailed Description
The Export‐VM cmdlet exports a virtual machine to disk. This cmdlet creates a folder at a specified location having three subfolders: Snapshots, Virtual Hard Disks, and
Virtual Machines. The Snapshots and Virtual Hard Disks folders contain the snapshots of and virtual hard disks of the specified virtual machine respectively. The Virtual
Machines folder contains the configuration XML of the specified virtual machine.
Parameters
‐AsJob
Specifies that the cmdlet is to be run as a background job.
Aliases none
Required? false
Position? named
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the virtual machine is to be exported. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
Accept Pipeline Input? false
‐Name<String[]>
Specifies the name of the virtual machine to be exported.
Aliases none
Required? true
Position? 1
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.VirtualMachine object is to be passed through to the pipeline representing the virtual machine to be exported.
Aliases none
Required? false
Position? named
‐Path<String>
Specifies the path to the folder into which the virtual machine is to be exported.
Aliases none
Required? true
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine to be exported.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Exports virtual machine Test to the root of the D drive.
Windows PowerShell
PS C:\> Export‐VM –Name Test –Path D:\
Example 2
Exports all virtual machines to the root of the D drive. Each virtual machine will be exported to its own folder.
Windows PowerShell
PS C:\> Get‐VM | Export‐VM –Path D:\
© 2015 Microsoft
Export‐VMSnapshot
Windows Server 2012 R2 and Windows 8.1
Export‐VMSnapshot
Exports a virtual machine checkpoint to disk.
Syntax
Parameter Set: SnapshotName
Export‐VMSnapshot [‐Name] <String[]> [‐Path] <String> ‐VMName <String[]> [‐AsJob] [‐ComputerName <String[]> ] [‐Passthru] [‐Confirm] [‐What
Parameter Set: SnapshotObject
Export‐VMSnapshot [‐VMSnapshot] <VMSnapshot[]> [‐Path] <String> [‐AsJob] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Export‐VMSnapshot [‐VM] <VirtualMachine[]> [‐Path] <String> ‐Name <String[]> [‐AsJob] [‐Passthru] [‐Confirm] [‐WhatIf] [ <CommonParameters>
Detailed Description
The Export‐VMSnapshot cmdlet exports a virtual machine checkpoint to disk.
Note: In Windows Server 2012 R2, virtual machine snapshots were renamed to virtual machine checkpoints. For clarity, this document will refer to virtual machine
snapshots as checkpoints.
Parameters
‐AsJob
Specifies that the cmdlet is to be run a background job.
Aliases none
Required? false
Position? named
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the virtual machine checkpoint is to be exported. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the checkpoint to be exported.
Aliases none
Required? true
Position? named
‐Passthru
Specifies that a VMSnapshot object is to be passed through to the pipeline representing the checkpoint to be exported.
Aliases none
Required? false
Position? named
‐Path<String>
Specifies the path to the folder into which the checkpoint is to be exported.
Aliases none
Required? true
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine of which the checkpoint is to be exported.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine of which the checkpoint is to be exported.
Aliases none
Required? true
Position? named
‐VMSnapshot<VMSnapshot[]>
Specifies the checkpoint to be exported.
Aliases none
Required? true
Position? 1
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Exports checkpoint Base Image of virtual machine TestVM to D:\.
Windows PowerShell
PS C:\> Export‐VMSnapshot –Name 'Base Image' –VMName TestVM –Path D:\
© 2015 Microsoft
Get‐VHD
Windows Server 2012 R2 and Windows 8.1
Get‐VHD
Gets the virtual hard disk object associated with a virtual hard disk.
Syntax
Parameter Set: Path
Get‐VHD [‐Path] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: Disk
Get‐VHD [‐DiskNumber] <UInt32> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMId
Get‐VHD [‐VMId] <Guid[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VHD cmdlet gets the virtual hard disk object associated with a virtual hard disk.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which a virtual hard disk is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐DiskNumber<UInt32>
Specifies the disk number associated with the virtual hard disk to be retrieved.
Aliases none
Required? true
Position? 1
‐Path<String[]>
Specifies the path to the virtual hard disk file of the virtual hard disk to be retrieved. If a filename or relative path is specified, the path is calculated relative to the
current working directory.
Aliases none
Required? true
Position? 1
‐VMId<Guid[]>
Specifies the virtual machine identifier of the virtual machine whose virtual hard disks are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
VHDObject[]
Examples
Example 1
Gets the virtual hard disk where the path to the virtual hard disk file is c:\test\testvhdx.vhdx.
Windows PowerShell
PS C:\> Get‐VHD –Path c:\test\testvhdx.vhdx
Example 2
Gets the virtual hard disk attached to the system with disk number 6.
Windows PowerShell
PS C:\> Get‐VHD –DiskNumber 6
Example 3
Gets the virtual hard disk objects associated with virtual machine TestVM, using the pipeline feature for the VMId parameter.
Windows PowerShell
PS C:\> Get‐VM ‐VMName TestVM | Select‐Object VMId | Get‐VHD
Example 4
Gets the virtual hard disk objects associated with virtual machine testvm using the pipeline feature for the path parameter.
Windows PowerShell
PS C:\> Get‐VM –VMName testvm | Select‐Object vmid | Get‐VHD
Example 5
Gets the virtual hard disk object for all the virtual hard disk files that are contained in the specified directory and its subdirectories.
Windows PowerShell
PS C:\> Get‐ChildItem c:\test –Recurse |% {$_.FullName} | Get‐VHD –ErrorAction SilentlyContinue
© 2015 Microsoft
Get‐VM
Windows Server 2012 R2 and Windows 8.1
Get‐VM
Gets the virtual machines from one or more Hyper‐V hosts.
Syntax
Parameter Set: Name
Get‐VM [[‐Name] <String[]> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: ClusterObject
Get‐VM [‐ClusterObject] <PSObject> [ <CommonParameters>]
Parameter Set: Id
Get‐VM [[‐Id] <Guid> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VM cmdlet gets the virtual machines from one or more Hyper‐V hosts.
Parameters
‐ClusterObject<PSObject>
Specifies the cluster resource or cluster group of the virtual machine to be retrieved.
Aliases none
Required? true
Position? 1
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which virtual machines are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Id<Guid>
Specifies the identifier of the virtual machine to be retrieved.
Aliases none
Required? false
Position? 1
‐Name<String[]>
Specifies the name of the virtual machine to be retrieved.
Aliases VMName
Required? false
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.VirtualMachine
Examples
Example 1
This example gets all virtual machines on the local virtual machine host.
Windows PowerShell
PS C:\> Get‐VM
Example 2
This example gets all virtual machines on Hyper‐V host Server1 that are running.
Windows PowerShell
PS C:\> Get‐VM –ComputerName Server1 | Where‐Object {$_.State –eq 'Running'}
Example 3
This example gets all virtual machines in the cluster to which the local Hyper‐V host is joined.
Windows PowerShell
PS C:\> Get‐ClusterGroup | ? {$_.GroupType –eq 'VirtualMachine' } | Get‐VM
© 2015 Microsoft
Get‐VMBios
Windows Server 2012 R2 and Windows 8.1
Get‐VMBios
Gets the BIOS of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMBios [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMBios [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMBios [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMBios cmdlet gets the BIOS of a virtual machine or snapshot. Note: This cmdlet does not operate with Generation 2 virtual machine. If attempted, the cmdlet
throws an error.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the BIOS of a virtual machine or snapshot is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies the virtual machine whose BIOS is to be retrieved.
Aliases none
Required? true
Position? 1
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the virtual machine snapshot whose BIOS is to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.Bios
Examples
Example 1
Gets the BIOS object for virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMBios TestVM
© 2015 Microsoft
Get‐VMComPort
Windows Server 2012 R2 and Windows 8.1
Get‐VMComPort
Gets the COM ports of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMComPort [‐VMName] <String[]> [[‐Number] <Int32> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMComPort [‐VM] <VirtualMachine[]> [[‐Number] <Int32> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMComPort [‐VMSnapshot] <VMSnapshot> [[‐Number] <Int32> ] [ <CommonParameters>]
Detailed Description
The Get‐VMComPort cmdlet gets the COM ports of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the COM ports of a virtual machine or snapshot are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified
domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Number<Int32>
Specifies the Id ﴾1 or 2﴿ of the COM ports to be retrieved.
Aliases none
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine whose COM ports are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose COM ports are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose COM ports are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.ComPort
Examples
Example 1
Gets all COM ports associated with virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMComPort TestVM
Example 2
Gets the second COM port associated with virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMComPort TestVM –Number 2
© 2015 Microsoft
Get‐VMConnectAccess
Windows Server 2012 R2 and Windows 8.1
Get‐VMConnectAccess
Gets entries showing users and the virtual machines to which they can connect on one or more Hyper‐V hosts.
Syntax
Parameter Set: VMName
Get‐VMConnectAccess [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐UserName <String[]> ] [ <CommonParameters>]
Parameter Set: VMId
Get‐VMConnectAccess [‐VMId] <Guid[]> [‐ComputerName <String[]> ] [‐UserName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMConnectAccess [‐VM] <VirtualMachine[]> [‐ComputerName <String[]> ] [‐UserName <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMConnectAccess cmdlet gets entries showing users and the virtual machines to which they can connect on one or more Hyper‐V hosts. This cmdlet is
intended for use in providing other applications with the appropriate permissions required to initiate a session with the Virtual Machine Connection protocol. Examples
of such applications are Virtual Machine Manager.
Parameters
‐ComputerName<String[]>
Specifies one or more virtual machine hosts on which connect access entries are being sought. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐UserName<String[]>
Specifies the user or users for whom connect access entries are being sought, in one of the following forms:
Security Identifier:
S‐1‐5‐21‐3165297888‐301567370‐576410423‐1103
Aliases UserId,Sid
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet gets the connect access entries for the virtual machines that you specify. To obtain a virtual machine object, use
the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMId<Guid[]>
Specifies the unique identifier of a virtual machine for which connect access entries are being sought.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine for which connect access entries are being sought.
Aliases none
Required? false
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.VMConnectAce
Examples
Example 1
This command gets a list of all the users who have access to connect to any virtual machine on the local computer. The example assumes that the Grant‐
VMConnectAccess has been run previously for at least one user account.
Windows PowerShell
PS C:\> Get‐VMConnectAccess
Example 2
This command gets a list of all the users who have access to connect to virtual machine VM1. The example assumes that the Grant‐VMConnectAccess has been run
previously for at least one user account for virtual machine VM1.
Windows PowerShell
PS C:\> Get‐VMConnectAccess –VMName VM1
Example 3
This command gets a list of all the virtual machines on the local computer that user Contoso\John has access to connect to. The example assumes that the Grant‐
VMConnectAccess has been run previously to grant access to Contoso\John.
Windows PowerShell
PS C:\> Get‐VMConnectAccess –UserName CONTOSO\John
© 2015 Microsoft
Get‐VMDvdDrive
Windows Server 2012 R2 and Windows 8.1
Get‐VMDvdDrive
Gets the DVD drives attached to a virtual machine or snapshot.
Syntax
Parameter Set: VMDriveController
Get‐VMDvdDrive [‐VMDriveController] <VMDriveController[]> [‐ControllerLocation <Int32> ] [ <CommonParameters>]
Parameter Set: VMName
Get‐VMDvdDrive [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐ControllerLocation <Int32> ] [‐ControllerNumber <Int32> ] [ <CommonParame
Parameter Set: VMObject
Get‐VMDvdDrive [‐VM] <VirtualMachine[]> [‐ControllerLocation <Int32> ] [‐ControllerNumber <Int32> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMDvdDrive [‐VMSnapshot] <VMSnapshot> [‐ControllerLocation <Int32> ] [‐ControllerNumber <Int32> ] [ <CommonParameters>]
Detailed Description
The Get‐VMDvdDrive cmdlet gets the DVD drives attached to a virtual machine or snapshot. This cmdlet has no ControllerType parameter, as the Get‐
VMHardDiskDrive cmdlet does, because virtual DVD drives can be attached only to the IDE controller.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which the DVD drives are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐ControllerLocation<Int32>
Specifies the number of the location on the controller from which the DVD drives are to be retrieved.
Aliases none
Required? false
Position? named
Default Value none
‐ControllerNumber<Int32>
Specifies the number of the controller from which the DVD drives are to be retrieved.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine from which the DVD drives are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMDriveController<VMDriveController[]>
Specifies the controller from which the DVD drives are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine from which the DVD drives are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the virtual machine snapshot from which the DVD drives are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.VMDriveController[]
Microsoft.HyperV.PowerShell.VMSnapshot
Microsoft.HyperV.PowerShell.VirtualMachine[]
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.DvdDrive
Examples
Example 1
Gets the virtual DVD drives from virtual machine Test.
Windows PowerShell
PS C:\> Get‐VMDvdDrive –VMName Test
Example 2
Gets the virtual DVD drives from IDE controller 1 of virtual machine Test.
Windows PowerShell
PS C:\> Get‐VM –Name Test | Get‐VMDvdDrive –ControllerNumber 1
Example 3
Gets the virtual DVD drives from IDE controller 1 of virtual machine TestVM located on Hyper‐V server Development.
Windows PowerShell
PS C:\> Get‐VMIdeController –VMName TestVM –ControllerNumber 1 –ComputerName Development | Get‐VMDvdDrive
Example 4
Gets the virtual DVD drives from snapshot Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMSnapshot –VMName TestVM –Name 'Before applying updates' | Get‐VMDvdDrive
© 2015 Microsoft
Get‐VMFibreChannelHba
Windows Server 2012 R2 and Windows 8.1
Get‐VMFibreChannelHba
Gets the Fibre Channel host bus adapters associated with one or more virtual machines.
Syntax
Parameter Set: VMName
Get‐VMFibreChannelHba [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMFibreChannelHba [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Detailed Description
Lists all of the fibre channel objects for each virtual fibre channel controller that is connected to the specified virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the Fibre Channel host bus adapters are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies a virtual machine or machines for which the Fibre Channel host bus adapters are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the friendly name or names of the virtual machines for which the Fibre Channel host bus adapters are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets the Fibre Channel host bus adapters associated with the virtual machine MyVM.
Windows PowerShell
PS C:\> Get‐VMFibreChannelHba –VMName MyVM
© 2015 Microsoft
Get‐VMFirmware
Windows Server 2012 R2 and Windows 8.1
Get‐VMFirmware
Gets the firmware configuration of a virtual machine.
Syntax
Parameter Set: VMName
Get‐VMFirmware [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMFirmware [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMFirmware [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMFirmware cmdlet gets the firmware configuration of a virtual machine. Note: This cmdlet is supported only on Generation 2 virtual machines.
Parameters
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet gets the virtual machine firmware from the hosts you specify.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet gets the firmware configuration for the virtual machines you specify. To obtain a virtual machine object, use the
Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies an array of names of virtual machines. The cmdlet gets the firmware configuration for the virtual machines you specify.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the virtual machine snapshot to be used with the VM when retrieving the firmware configuration.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.VMFirmware
Notes
Note: This cmdlet is supported only on Generation 2 virtual machines.
Examples
Example 1
This example returns a virtual machine firmware object for the virtual machine “Test VM”.
Windows PowerShell
PS C:\> Get‐VMFirmware "Test VM"
Related topics
Set‐VMFirmware
© 2015 Microsoft
Get‐VMFloppyDiskDrive
Windows Server 2012 R2 and Windows 8.1
Get‐VMFloppyDiskDrive
Gets the floppy disk drives of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMFloppyDiskDrive [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMFloppyDiskDrive [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMFloppyDiskDrive [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMFloppyDiskDrive cmdlet gets the floppy disk drives of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which floppy disk drives are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies the virtual machine whose floppy disk drives are to be retrieved.
Aliases none
Required? true
Position? 1
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose floppy disk drives are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.FloppyDiskDrive
Examples
Example 1
Gets the floppy disk drive for virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMFloppyDiskDrive TestVM
© 2015 Microsoft
Get‐VMHardDiskDrive
Windows Server 2012 R2 and Windows 8.1
Get‐VMHardDiskDrive
Gets the virtual hard disk drives attached to one or more virtual machines.
Syntax
Parameter Set: VMDriveController
Get‐VMHardDiskDrive [‐VMDriveController] <VMDriveController[]> [‐ControllerLocation <Int32> ] [ <CommonParameters>]
Parameter Set: VMName
Get‐VMHardDiskDrive [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐ControllerLocation <Int32> ] [‐ControllerNumber <Int32> ] [‐Controll
Parameter Set: VMObject
Get‐VMHardDiskDrive [‐VM] <VirtualMachine[]> [‐ControllerLocation <Int32> ] [‐ControllerNumber <Int32> ] [‐ControllerType <ControllerType>
Parameter Set: VMSnapshot
Get‐VMHardDiskDrive [‐VMSnapshot] <VMSnapshot> [‐ControllerLocation <Int32> ] [‐ControllerNumber <Int32> ] [‐ControllerType <ControllerType
Detailed Description
The Get‐VMHardDiskDrive cmdlet gets the virtual hard disk drives attached to one or more virtual machines.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which the virtual hard disk drives are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐ControllerLocation<Int32>
Specifies the number of the location on the controller at which the virtual hard disk drives are to be retrieved. If not specified, the number of the first available location
on the controller is used.
Aliases none
Required? false
Position? named
Aliases none
Required? false
Position? named
‐ControllerType<ControllerType>
Specifies the type of the controller from which the virtual hard disk drives are to be retrieved. Allowed values are Floppy, IDE, and SCSI.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine from which the virtual hard disk drives are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMDriveController<VMDriveController[]>
Specifies the drive controller from which the virtual hard disk drives are to be retreived.
Aliases none
Required? true
Position? 1
Default Value none
‐VMName<String[]>
Specifies the name of the virtual machine from which the virtual hard disks drives are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot from which the virtual hard disk drives are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.HyperV.PowerShell.ControllerType
Microsoft.HyperV.PowerShell.VMSnapshot
Microsoft.HyperV.PowerShell.VMDriveController[]
Microsoft.HyperV.PowerShell.VirtualMachine[]
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.HardDiskDrive
Examples
Example 1
Gets the virtual hard drives from virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMHardDiskDrive –VMName TestVM
Example 2
Gets the virtual hard drives from IDE controller 1 of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VM –Name TestVM | Get‐VMHardDiskDrive –ControllerType IDE –ControllerNumber 1
Example 3
Gets the virtual hard drives from IDE controller 1 of virtual machine TestVM located on Hyper‐V host Development.
Windows PowerShell
PS C:\> Get‐VMIdeController –VMName TestVM –ControllerNumber 1 –ComputerName Development | Get‐VMHardDiskDrive
Example 4
Gets the virtual hard drives from snapshot Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMSnapshot –VMName Test –Name 'Before applying updates' | Get‐VMHardDrive
© 2015 Microsoft
Get‐VMHost
Windows Server 2012 R2 and Windows 8.1
Get‐VMHost
Gets a Hyper‐V host.
Syntax
Parameter Set: Default
Get‐VMHost [[‐ComputerName] <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMHost cmdlet gets a Hyper‐V host.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The default is the local computer —
use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? 1
Default Value .
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.Host
Examples
Example 1
Gets the local Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMHost
© 2015 Microsoft
Get‐VMHostNumaNode
Windows Server 2012 R2 and Windows 8.1
Get‐VMHostNumaNode
Gets the NUMA topology of a virtual machine host.
Syntax
Parameter Set: Default
Get‐VMHostNumaNode [[‐ComputerName] <String[]> ] [‐Id <Int32> ] [ <CommonParameters>]
Detailed Description
The Get‐MVHostNumaNode cmdlet gets the NUMA topology of a Hyper‐V host, returning a VMHostNumaNode object for each of the host’s NUMA nodes.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts for which the NUMA topology is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? 1
Default Value .
‐Id<Int32>
Identifies a NUMA node for which a VMHostNumaNode is to be retrieved.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets the NUMA topology of the local Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMHostNumaNode
© 2015 Microsoft
Get‐VMHostNumaNodeStatus
Windows Server 2012 R2 and Windows 8.1
Get‐VMHostNumaNodeStatus
Gets the status of the virtual machines on the non‐uniform memory access ﴾NUMA﴿ nodes of a virtual machine host or hosts.
Syntax
Parameter Set: Default
Get‐VMHostNumaNodeStatus [[‐ComputerName] <String[]> ] [‐Id <Int32> ] [ <CommonParameters>]
Detailed Description
Gets the status of the virtual machines on the non‐uniform memory access ﴾NUMA﴿ nodes of a virtual machine host or hosts. If the virtual machine host enables NUMA
spanning, this cmdlet returns an error.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which NUMA node status is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? 1
Default Value .
‐Id<Int32>
Identifies a NUMA node for which virtual machine status is to be retrieved.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
VMNumaNodeStatus[]
Examples
Example 1
Gets the status of the virtual machines on the non‐uniform memory access ﴾NUMA﴿ nodes of the local Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMHostNumaNodeStatus
© 2015 Microsoft
Get‐VMIdeController
Windows Server 2012 R2 and Windows 8.1
Get‐VMIdeController
Gets the IDE controllers of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMIdeController [‐VMName] <String[]> [[‐ControllerNumber] <Int32> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMIdeController [‐VM] <VirtualMachine[]> [[‐ControllerNumber] <Int32> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMIdeController [‐VMSnapshot] <VMSnapshot> [[‐ControllerNumber] <Int32> ] [ <CommonParameters>]
Detailed Description
The Get‐VMIdeController cmdlet gets the IDE controllers of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the IDE controllers of a virtual machine or snapshot are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified
domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐ControllerNumber<Int32>
Specifies the number of the IDE controller to be retrieved. Allowed values are 0 and 1.
Aliases none
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine whose IDE controllers are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose IDE controllers are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose IDE controllers are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.IDEController
Examples
Example 1
Gets all IDE controllers belonging to virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMIdeController TestVM
Example 2
Gets the first IDE controller belonging to virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMIdeController TestVM –ControllerNumber 0
© 2015 Microsoft
Get‐VMIntegrationService
Windows Server 2012 R2 and Windows 8.1
Get‐VMIntegrationService
Gets the integration services of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMIntegrationService [‐VMName] <String[]> [[‐Name] <String[]> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMIntegrationService [‐VM] <VirtualMachine[]> [[‐Name] <String[]> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMIntegrationService [‐VMSnapshot] <VMSnapshot> [[‐Name] <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMIntegrationService cmdlet gets the integration services of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the integration services are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the integration service to be retrieved.
Aliases none
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine from which the integration services are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine from which the integration services are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot from which the integration services are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.IntegrationService
Examples
Example 1
Gets the out‐of‐date integration services from virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMIntegrationService –VMName TestVM | Where‐Object {$_.SecondaryOperationalStatus –eq 'ProtocolMismatch'}
Example 2
Gets the Shutdown and VSS integration services from virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VM –Name TestVM | Get‐VMIntegrationService –Name Shutdown,VSS
Example 3
Gets the Shutdown and VSS integration services from the snapshot Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMSnapshot –VMName TestVM –Name 'Before applying updates' | Get‐VMIntegrationService Shutdown,VSS
© 2015 Microsoft
Get‐VMMemory
Windows Server 2012 R2 and Windows 8.1
Get‐VMMemory
Gets the memory of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMMemory [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMMemory [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMMemory [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMMemory cmdlet gets the memory of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the memory of a virtual machine or snapshot is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies the virtual machine whose memory is to be retrieved.
Aliases none
Required? true
Position? 1
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose memory is to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.Memory
Examples
Example 1
Gets the memory object for virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMMemory TestVM
© 2015 Microsoft
Get‐VMMigrationNetwork
Windows Server 2012 R2 and Windows 8.1
Get‐VMMigrationNetwork
Gets the networks added for migration to one or more virtual machine hosts.
Syntax
Parameter Set: Default
Get‐VMMigrationNetwork [[‐Subnet] <String[]> ] [‐ComputerName <String[]> ] [‐Priority <UInt32[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMMigrationNetwork cmdlet gets the networks added for migration to one or more virtual machine hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the networks added for migration are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Priority<UInt32[]>
Specifies the priority of the networks to be retrieved.
Aliases none
Required? false
Position? named
‐Subnet<String[]>
Specifies a string representing an IPv4 or IPv6 subnet mask which identifies the networks to be retrieved.
Aliases none
Required? false
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.MigrationNetwork
Examples
Example 1
Gets all networks added for migration to the local virtual machine host.
Windows PowerShell
PS C:\> Get‐VMMigrationNetwork
Example 2
Gets all networks added for migration to the local virtual machine host having a priority of 8.
Windows PowerShell
PS C:\> Get‐VMMigrationNetwork –Priority 8
Example 3
Gets all networks added for migration having a subnet starting with 192.168.
Windows PowerShell
PS C:\> Get‐VMMigrationNetwork 192.168.*
© 2015 Microsoft
Get‐VMNetworkAdapter
Windows Server 2012 R2 and Windows 8.1
Get‐VMNetworkAdapter
Gets the virtual network adapters of a virtual machine, snapshot, management OS, or of a virtual machine and management OS.
Syntax
Parameter Set: VMName
Get‐VMNetworkAdapter [‐VMName] <String[]> [[‐Name] <String> ] [‐ComputerName <String[]> ] [‐IsLegacy <Boolean> ] [ <CommonParameters>]
Parameter Set: All
Get‐VMNetworkAdapter [‐All] [[‐Name] <String> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: ManagementOS
Get‐VMNetworkAdapter [[‐Name] <String> ] ‐ManagementOS [‐ComputerName <String[]> ] [‐SwitchName <String> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMNetworkAdapter [‐VM] <VirtualMachine[]> [[‐Name] <String> ] [‐IsLegacy <Boolean> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMNetworkAdapter [‐VMSnapshot] <VMSnapshot> [[‐Name] <String> ] [ <CommonParameters>]
Detailed Description
The Get‐VMNetworkAdapter cmdlet gets the virtual network adapters of the specified virtual machine, snapshot, or management OS.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on the virtual network adapters are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐IsLegacy<Boolean>
Specify as $TRUE to retrieve only legacy network adapters, or as $FALSE to retrieve only synthetic network adapters. If not specified, virtual network adapters of both
types are retrieved.
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies the management OS, i.e. the virtual machine host OS.
Aliases none
Required? true
Position? named
‐Name<String>
Specifies the name of the network adapter to be retrieved.
Aliases VMNetworkAdapterName
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine whose virtual network adapters are to be retrieved. . The asterisk, “*”, is the wildcard. If it is specified the cmdlet returns virtual network
adapters from every virtual machine in the system.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose network adapters are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose network adapters are to be retrieved.
Aliases none
Required? true
Position? 1
‐SwitchName<String>
Specifies the name of the virtual switch whose network adapters are to be retrieved. ﴾This parameter is available only for virtual network adapters in the management
OS.﴿
Aliases none
Required? false
Position? named
‐All
Specifies all virtual network adapters in the system, regardless of whether the virtual network adapter is in the management OS or in a virtual machine.
Aliases none
Required? true
Position? 2
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets virtual network adapters from all virtual machines on the local Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapter –VMName *
Example 2
Gets the virtual network adapters in the ManagementOS ﴾i.e. the local Hyper‐V host﴿.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapter ‐ManagementOS
Example 3
Gets virtual network adapters from all virtual machines as well as the management OS.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapter ‐All
© 2015 Microsoft
Get‐VMNetworkAdapterAcl
Windows Server 2012 R2 and Windows 8.1
Get‐VMNetworkAdapterAcl
Gets the ACLs configured for a virtual machine network adapter.
Syntax
Parameter Set: VMName
Get‐VMNetworkAdapterAcl [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ManagementOS
Get‐VMNetworkAdapterAcl ‐ManagementOS [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ResourceObject
Get‐VMNetworkAdapterAcl [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMNetworkAdapterAcl [‐VM] <VirtualMachine[]> [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMNetworkAdapterAcl [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMNetworkAdapterAcl cmdlet gets the ACLs configured for a virtual machine network adapter. If an ACL entry is created to be applied to both directions, it
will appear under the list of entries for the inbound direction and under the list of entries for the outbound direction in the output from Get‐VMNetworkAdapterAcl.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the ACLs configured for a virtual machine network adapter are to be retrieved. NetBIOS names, IP addresses, and fully‐
qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies that the ACLs are to be configured in the management ﴾i.e. the parent, or host﴿ operating system.
Aliases none
Required? true
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine in which the ACLs configured for a virtual machine network adapter are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine in which the ACLs configured for a virtual machine network adapter are to be retrieved.
Aliases none
Required? false
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual network adapter for which the configured ACLs are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the virtual network adapter name for which the configured ACLs are to be retrieved.
Aliases none
Required? false
Position? named
‐VMSnapshot<VMSnapshot>
Specifies the snapshot in which the ACLs configured for a virtual machine network adapter are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets all the port ACLs configured on virtual machine Redmond.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterAcl –VMName Redmond
© 2015 Microsoft
Get‐VMNetworkAdapterExtendedAcl
Windows Server 2012 R2 and Windows 8.1
Get‐VMNetworkAdapterExtendedAcl
Gets extended ACLs configured for a virtual network adapter.
Syntax
Parameter Set: VMName
Get‐VMNetworkAdapterExtendedAcl [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ManagementOS
Get‐VMNetworkAdapterExtendedAcl ‐ManagementOS [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ResourceObject
Get‐VMNetworkAdapterExtendedAcl [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMNetworkAdapterExtendedAcl [‐VM] <VirtualMachine[]> [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMNetworkAdapterExtendedAcl [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMNetworkAdapterExtendedAcl cmdlet gets the extended access control lists ﴾ACLs﴿ configured for a virtual network adapter. If an ACL applies to both
inbound and outbound packets, it appears in both inbound and outbound lists.
Parameters
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet gets the ACLs associated with the virtual network adapters on the Hyper‐V hosts that you specify.
Aliases none
Required? false
Position? named
‐ManagementOS
Indicates that the cmdlet operates on the parent or host operating system. If you specify this parameter, this cmdlet gets ACLs associated with network adapters in the
parent or host operating system.
Aliases none
Required? true
Position? named
‐VM<VirtualMachine[]>
Specifies an array of virtual machines as VirtualMachine objects. The cmdlet gets ACLs for network adapters that belong to the virtual machines that you specify. To
obtain a virtual machine object, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies an array of names of VMs. The cmdlet gets ACLs associated with network adapters that belong to the VMs that you specify.
Aliases none
Required? false
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies an array of virtual network adapter objects. The cmdlet gets ACLs associated with the adapters that you specify. To obtain a network adapter, use the Get‐
VMNetworkAdapter cmdlet.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of a virtual network adapter. The cmdlet gets extended ACLs associated with the adapter that you specify.
Aliases none
Required? false
Position? named
‐VMSnapshot<VMSnapshot>
Specifies a snapshot as a VMSnapshot object. The cmdlet gets ACLs for network adapters that belong to the snapshot that you specify. To obtain a snapshot, use the
Get‐VMSnapshot cmdlet.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShellMicrosoft.HyperV.PowerShell.VMNetworkAdapterExtendedAclSetting
Examples
Example 1: Get all extended ACLs
This command gets all the extended ACLs for the virtual machine named TSQA01.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterExtendedAcl ‐VMName "TSQA01"
Related topics
Add‐VMNetworkAdapterExtendedAcl
Remove‐VMNetworkAdapterExtendedAcl
Get‐VM
Get‐VMNetworkAdapter
Get‐VMSnapshot
© 2015 Microsoft
Get‐VMNetworkAdapterFailoverConfiguration
Windows Server 2012 R2 and Windows 8.1
Get‐VMNetworkAdapterFailoverConfiguration
Gets the IP address of a virtual network adapter configured to be used when a virtual machine fails over.
Syntax
Parameter Set: VMName
Get‐VMNetworkAdapterFailoverConfiguration [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [‐Confirm] [‐W
Parameter Set: ResourceObject
Get‐VMNetworkAdapterFailoverConfiguration [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [‐Confirm] [‐WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMNetworkAdapterFailoverConfiguration [‐VM] <VirtualMachine[]> [‐VMNetworkAdapterName <String> ] [‐Confirm] [‐WhatIf] [ <CommonParamete
Detailed Description
The Get‐VMNetworkAdapterFailoverConfiguration cmdlet gets the IP address configuration of a virtual network adapter configured to be used when a virtual
machine fails over.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the IP address configuration of a virtual network adapter is to be retrieved. NetBIOS names, IP addresses, and fully‐
qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies the virtual machine for which you want to get the IP address configuration of a virtual network adapter.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine for which you want to get the IP address configuration of a virtual network adapter.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual network adapter whose IP address configuration you want to get.
Aliases none
Required? true
Position? 1
Aliases none
Required? false
Position? named
‐Confirm
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
‐WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
VMNetworkAdapterFailoverConfiguration
Examples
Example 1
This example gets the failover IP address configuration of all virtual network adapters attached to a virtual machine named VM01.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterFailoverConfiguration VM01
Example 2
This example gets the failover IP address configuration of a virtual network adapter named NetworkAdapter on a virtual machine named VM01.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterFailoverConfiguration VM01 –VMNetworkAdapterName NetworkAdapter
© 2015 Microsoft
Get‐VmNetworkAdapterIsolation
Windows Server 2012 R2 and Windows 8.1
Get‐VmNetworkAdapterIsolation
Gets isolation settings for a virtual network adapter.
Syntax
Parameter Set: VMName
Get‐VmNetworkAdapterIsolation [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ManagementOS
Get‐VmNetworkAdapterIsolation ‐ManagementOS [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ResourceObject
Get‐VmNetworkAdapterIsolation [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [ <CommonParameters>]
Parameter Set: VMObject
Get‐VmNetworkAdapterIsolation [‐VM] <VirtualMachine[]> [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VmNetworkAdapterIsolation [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VmNetworkAdapterIsolation cmdlet gets isolation settings for a virtual network adapter. The cmdlet displays the isolation method, and other information,
such as the multitenancy mode and the subnet ID for traffic bound for to the default compartment if multitenancy is enabled.
Parameters
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet gets isolation settings for virtual machines hosted by the computers that you specify.
Aliases none
Required? false
Position? named
Default Value none
‐ManagementOS
Indicates that the cmdlet operates on the parent or host operating system. If you specify this parameter, this cmdlet gets isolation settings for the parent or host
operating system.
Aliases none
Required? true
Position? named
‐VM<VirtualMachine[]>
Specifies an array of virtual machines. The cmdlet gets isolation settings for adapters that belong to the virtual machines that you specify. To obtain a virtual machine
object, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies an array of names of virtual machines. The cmdlet gets isolation settings for adapters that belong to the virtual machines that you specify.
Aliases none
Required? false
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies an array virtual machine network adapters as VMNetworkAdapterBase objects. The cmdlet gets isolation settings for the adapters that you specify. To obtain
a network adapter, use the Get‐VMNetworkAdapter cmdlet.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of a virtual network adapter. The cmdlet gets isolation settings for the adapters that you specify.
Aliases none
Required? false
Position? named
‐VMSnapshot<VMSnapshot>
Specifies a snapshot as a VMSnapshot object. The cmdlet gets isolation settings for network adapters that belong to the snapshot that you specify. To obtain a
snapshot, use the Get‐VMSnapshot cmdlet.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
None
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.VMNetworkAdapterIsolation
Examples
Example 1
This example retrieves the isolation settings of a VM.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterIsolation –VMName Multitenant‐GW –VMNetworkAdapterName InternalNIC
Related topics
Set‐VmNetworkAdapterIsolation
Get‐VM
Get‐VMSnapshot
Get‐VMNetworkAdapter
© 2015 Microsoft
Get‐VMNetworkAdapterRoutingDomainMapping
Windows Server 2012 R2 and Windows 8.1
Get‐VMNetworkAdapterRoutingDomainMapping
Gets members of a routing domain.
Syntax
Parameter Set: VMName
Get‐VMNetworkAdapterRoutingDomainMapping [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐RoutingDomainID <String> ] [‐RoutingDomainNa
Parameter Set: ManagementOS
Get‐VMNetworkAdapterRoutingDomainMapping ‐ManagementOS [‐ComputerName <String[]> ] [‐RoutingDomainID <String> ] [‐RoutingDomainName <String
Parameter Set: ResourceObject
Get‐VMNetworkAdapterRoutingDomainMapping [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [‐RoutingDomainID <String> ] [‐RoutingDomainName <Str
Parameter Set: VMObject
Get‐VMNetworkAdapterRoutingDomainMapping [‐VM] <VirtualMachine[]> [‐RoutingDomainID <String> ] [‐RoutingDomainName <String> ] [‐VMNetworkAd
Parameter Set: VMSnapshot
Get‐VMNetworkAdapterRoutingDomainMapping [‐VMSnapshot] <VMSnapshot> [‐RoutingDomainID <String> ] [‐RoutingDomainName <String> ] [ <CommonPa
Detailed Description
The Get‐VmNetworkAdapterRoutingDomainMapping cmdlet gets members of a routing domain.
Parameters
‐ComputerName<String[]>
Specifies an array of Hyper‐V hosts. The cmdlet gets the members of a routing domain on the Hyper‐V hosts that you specify.
Aliases none
Required? false
Position? named
‐ManagementOS
Indicates that the cmdlet operates on the parent partition or host operating system.
Aliases none
Required? true
Position? named
‐RoutingDomainID<String>
Specifies the ID of a routing domain. The ID of a routing domain is a system‐assigned GUID. The cmdlet gets the members of the routing domain that you specify.
Aliases none
Required? false
Position? named
‐RoutingDomainName<String>
Specifies the name of a routing domain. The cmdlet gets the members of the routing domain that you specify.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet gets the members of the routing domain from the network interfaces that belong to the virtual machines that
you specify. To obtain a virtual machine object, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies an array of friendly names of virtual machines. The cmdlet gets the members of the routing domain from the network interfaces that belong to the virtual
machines that you specify.
Aliases none
Required? false
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies an array of virtual network adapters as a VMNetworkAdapterBase object. The cmdlet gets the members of the routing domain on the adapters that you
specify. To obtain a network adapter, use the Get‐VMNetworkAdapter cmdlet.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of a virtual network adapter. The cmdlet gets the members of the routing domain on the adapter that you specify.
Aliases none
Required? false
Position? named
Default Value none
‐VMSnapshot<VMSnapshot>
Specifies a snapshot as a VMSnapshot object. The cmdlet gets the members of the routing domain for network adapters that belong to the snapshot that you specify.
To obtain a snapshot object, use the Get‐VMSnapshot cmdlet.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Get members of a routing domain
This command gets the members of the routing domain from the network adapter named Internal NIC that belongs to the virtual machine named Gateway01.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterRoutingDomainMapping ‐VMName "Gateway01" ‐VMNetworkAdapterName "Internal NIC"
Related topics
Add‐VmNetworkAdapterRoutingDomainMapping
Set‐VmNetworkAdapterRoutingDomainMapping
Remove‐VMNetworkAdapterRoutingDomainMapping
© 2015 Microsoft
Get‐VMNetworkAdapterVlan
Windows Server 2012 R2 and Windows 8.1
Get‐VMNetworkAdapterVlan
Gets the virtual LAN settings configured on a virtual network adapter.
Syntax
Parameter Set: VMName
Get‐VMNetworkAdapterVlan [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ManagementOS
Get‐VMNetworkAdapterVlan ‐ManagementOS [‐ComputerName <String[]> ] [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: ResourceObject
Get‐VMNetworkAdapterVlan [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMNetworkAdapterVlan [‐VM] <VirtualMachine[]> [‐VMNetworkAdapterName <String> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMNetworkAdapterVlan [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMNetworkAdapterVlan cmdlet gets the virtual LAN settings configured on a virtual network adapter.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the virtual LAN settings configured on a virtual network adapter are to be retrieved. NetBIOS names, IP addresses, and
fully‐qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies that the virtual LAN settings are to be retrieved from the management ﴾i.e. parent, or host﴿ operating system.
Aliases none
Required? true
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine in which the virtual LAN settings configured on a virtual network adapter are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine in which the virtual LAN settings configured on a virtual network adapter are to be retrieved.
Aliases none
Required? false
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual network adapter for which the virtual LAN settings are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of the virtual network adapter for which the virtual LAN settings are to be retrieved.
Aliases none
Required? false
Position? named
‐VMSnapshot<VMSnapshot>
Specifies the snapshot in which the virtual LAN settings are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets the virtual LAN settings for each virtual network adapter in all virtual machines on the system.
Windows PowerShell
PS C:\> Get‐VMNetworkAdapterVlan
© 2015 Microsoft
Get‐VMProcessor
Windows Server 2012 R2 and Windows 8.1
Get‐VMProcessor
Gets the processor of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMProcessor [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMProcessor [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMProcessor [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMProcessor cmdlet gets the processor of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the processor of a virtual machine or snapshot is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified
domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies the virtual machine whose processor is to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose processor is to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose processor is to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.Processor
Examples
Example 1
Gets the processor object for virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMProcessor TestVM
© 2015 Microsoft
Get‐VMRemoteFx3dVideoAdapter
Windows Server 2012 R2 and Windows 8.1
Get‐VMRemoteFx3dVideoAdapter
Gets the RemoteFX video adapter of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMRemoteFx3dVideoAdapter [‐VMName] <String[]> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMRemoteFx3dVideoAdapter [‐VM] <VirtualMachine[]> [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMRemoteFx3dVideoAdapter [‐VMSnapshot] <VMSnapshot> [ <CommonParameters>]
Detailed Description
The Get‐VMRemoteFx3dVideoAdapter cmdlet gets the RemoteFX video adapter of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the RemoteFX video adapter is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐VM<VirtualMachine[]>
Specifies the virtual machine whose RemoteFX video adapter is to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose RemoteFX video adapter is to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose RemoteFX video adapter is to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.RemoteFxVideoAdapter
Examples
Example 1
Gets the RemoteFX adapter from virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMRemoteFx3dVideoAdapter –VMName TestVM
Example 2
Gets the RemoteFx adapter from virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VM –Name TestVM | Get‐VMRemoteFx3dVideoAdapter
Example 3
Gets the RemoteFx adapter from snapshot Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMSnapshot –VMName TestVM –Name 'Before applying updates' | Get‐VMRemoteFx3dVideoAdapter
© 2015 Microsoft
Get‐VMRemoteFXPhysicalVideoAdapter
Windows Server 2012 R2 and Windows 8.1
Get‐VMRemoteFXPhysicalVideoAdapter
Gets the RemoteFX physical graphics adapters on one or more Hyper‐V hosts.
Syntax
Parameter Set: Default
Get‐VMRemoteFXPhysicalVideoAdapter [[‐Name] <String[]> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMRemoteFXPhysicalVideoAdapter cmdlet gets the RemoteFX physical graphics adapters on one or more Hyper‐V hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which the RemoteFX physical graphics adapters are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the names of one or more RemoteFX physical graphics adapters to be retrieved.
Aliases none
Required? false
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.VMRemoteFXPhysicalVideoAdapter[]
Examples
Example 1
Gets all RemoteFX physical video adapters on the Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMRemoteFXPhysicalVideoAdapter
Example 2
Gets all RemoteFX physical video adapters on the Hyper‐V host which include the sequence Nvidia in their name.
Windows PowerShell
PS C:\> Get‐VMRemoteFXPhysicalVideoAdapter –Name *Nvidia*
© 2015 Microsoft
Get‐VMReplication
Windows Server 2012 R2 and Windows 8.1
Get‐VMReplication
Gets the replication settings for a virtual machine.
Syntax
Parameter Set: VMName
Get‐VMReplication [[‐VMName] <String[]> ] [‐ComputerName <String[]> ] [‐PrimaryServerName <String> ] [‐ReplicaServerName <String> ] [‐Repli
Parameter Set: VMObject
Get‐VMReplication [‐VM] <VirtualMachine[]> [‐ReplicationRelationshipType <VMReplicationRelationshipType> ] [ <CommonParameters>]
Detailed Description
The Get‐VMReplication cmdlet gets the replication settings for a virtual machine.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which virtual machine replication settings are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
Aliases PrimaryServer
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine whose replication settings are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose replication settings are to be retrieved.
Aliases Name
Required? false
Position? 1
‐ReplicaServerName<String>
Specifies the replica server name of the virtual machines whose replication settings are to be retrieved.
Aliases ReplicaServer
Required? false
Position? named
‐ReplicationHealth<VMReplicationHealthState>
Gets replication settings for virtual machines with the specified replication health state. Valid values are Normal, Warning, and Critical.
Aliases Health
Required? false
Position? named
‐ReplicationMode<VMReplicationMode>
Gets the replication settings for virtual machines with the specified replication mode. Valid values are None, Primary, Replica, and TestReplica.
Aliases Mode
Required? false
Position? named
‐ReplicationRelationshipType<VMReplicationRelationshipType>
Specifies the replication relationship type of the virtual machine. Specify whether the replication relationship is a simple primary to replica or is an extended replication
chain. The cmdlet gets the replication settings for the virtual machines that have the replication type that you specify.
Aliases Relationship
Required? false
Position? named
‐ReplicationState<VMReplicationState>
Gets replication settings for virtual machines with the specified replication state. Valid values are:
‐‐Error
‐‐FailOverWaitingCompletion
‐‐FailedOver
‐‐NotApplicable
‐‐ReadyForInitialReplication
‐‐Replicating
‐‐Resynchronizing
‐‐ResynchronizeSuspended
‐‐Suspended
‐‐SyncedReplicationComplete
‐‐WaitingForInitialReplication
‐‐WaitingForStartResynchronize
Aliases State
Required? false
Position? named
‐TrustGroup<String>
Specifies the trust group of the virtual machines whose replication settings you want to retrieve.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
VMReplication
Examples
Example 1
This example gets the replication settings of all replication‐enabled virtual machines on the local Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMReplication
Example 2
This example gets the replication settings of a virtual machine named VM01.
Windows PowerShell
PS C:\> Get‐VMReplication VM01
Example 3
This example gets the replication settings of all virtual machines replicating to server server01.domain01.contoso.com.
Windows PowerShell
PS C:\> Get‐VMReplication –ReplicaServerName server01.domain01.contoso.com
Example 4
This example gets the replication settings of all virtual machines in the Replicating state.
Windows PowerShell
PS C:\> Get‐VMReplication –ReplicationState Replicating
Example 5
This example gets the replication settings of all virtual machines in a trust group named DEFAULT.
Windows PowerShell
PS C:\> Get‐VMReplication –TrustGroup DEFAULT
Example 6
This example gets the replication settings of all primary virtual machines on the local host.
Windows PowerShell
PS C:\> Get‐VMReplication –ReplicationMode Primary
© 2015 Microsoft
Get‐VMReplicationAuthorizationEntry
Windows Server 2012 R2 and Windows 8.1
Get‐VMReplicationAuthorizationEntry
Gets the authorization entries of a Replica server.
Syntax
Parameter Set: Default
Get‐VMReplicationAuthorizationEntry [[‐AllowedPrimaryServer] <String> ] [‐ComputerName <String[]> ] [‐ReplicaStorageLocation <String> ] [‐T
Detailed Description
The Get‐VMReplicationAuthorizationEntry cmdlet gets the replication authorization entries specified for a Replica server.
Parameters
‐AllowedPrimaryServer<String>
Specifies the allowed primary server for which replication authorization entries are to be retrieved.
Aliases AllowedPS
Required? false
Position? 1
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which replication authorization entries are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐ReplicaStorageLocation<String>
Specifies the location where virtual hard disk files are stored when an authorized primary server sends replication data to the specified Replica server.
Aliases none
Required? false
Position? named
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
VMReplicationAuthorizationEntry
Examples
Example 1
This example gets the replication authorization entries for the local Replica server.
Windows PowerShell
PS C:\> Get‐VMReplicationAuthorizationEntry
Example 2
This example gets the replication authorization entry for an allowed primary server named server01.domain01.contoso.com.
Windows PowerShell
PS C:\> Get‐VMReplicationAuthorizationEntry server01.domain01.contoso.com
© 2015 Microsoft
Get‐VMReplicationServer
Windows Server 2012 R2 and Windows 8.1
Get‐VMReplicationServer
Gets the replication and authentication settings of a Replica server.
Syntax
Parameter Set: Default
Get‐VMReplicationServer [[‐ComputerName] <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMReplicationServer cmdlet gets the replication and authentication settings of a Replica server.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts for which to retrieve replication and authentication settings. NetBIOS names, IP addresses, and fully‐qualified domain names are
allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? 1
Default Value .
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
VMReplicationServer
Examples
Example 1
This example gets the replication configuration of the local Replica server.
Windows PowerShell
PS C:\> Get‐VMReplicationServer
Example 2
This example gets the replication configuration of a server named server01.domain01.contoso.com.
Windows PowerShell
PS C:\> Get‐VMReplicationServer server01.domain01.contoso.com
© 2015 Microsoft
Get‐VMResourcePool
Windows Server 2012 R2 and Windows 8.1
Get‐VMResourcePool
Gets the resource pools on one or more virtual machine hosts.
Syntax
Parameter Set: Default
Get‐VMResourcePool [[‐Name] <String[]> ] [[‐ResourcePoolType] <VMResourcePoolType[]> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMResourcePool cmdlet gets the resource pools on one or more virtual machine hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the resource pools are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the resource pool or pools to be retrieved. Wildcards are allowed.
Aliases none
Required? false
Position? 1
‐ResourcePoolType<VMResourcePoolType[]>
Required? false
Position? 2
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.ResourcePool
Examples
Example 1
Get all VHD resource pools on the local virtual machine host.
Windows PowerShell
PS C:\> Get‐VMResourcePool * VHD
Example 2
Get all resource pools on the local virtual machine host having a name that starts with Test.
Windows PowerShell
PS C:\> Get‐VMResourcePool Test*
Example 3
Get all VHD resource pools on the local virtual machine host named test resource pool.
Windows PowerShell
PS C:\> Get‐VMResourcePool "test resource pool" VHD
© 2015 Microsoft
Get‐VMSan
Windows Server 2012 R2 and Windows 8.1
Get‐VMSan
Gets the available virtual machine storage area networks on a Hyper‐V host or hosts.
Syntax
Parameter Set: Default
Get‐VMSan [[‐Name] <String[]> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMSan cmdlet gets the available virtual storage area networks ﴾SANs﴿ on one or more Hyper‐V hosts.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which the available virtual machine storage area networks ﴾SANs﴿ are to be retrieved. NetBIOS names, IP addresses, and fully‐
qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the friendly name of a virtual storage area network ﴾SAN﴿ to be retrieved.
Aliases none
Required? false
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.VMSan
Examples
Example 1
Gets a virtual storage area network ﴾SAN﴿ named ProductionSAN.
Windows PowerShell
PS C:\> Get‐VMSan –Name ProductionSAN
© 2015 Microsoft
Get‐VMScsiController
Windows Server 2012 R2 and Windows 8.1
Get‐VMScsiController
Gets the SCSI controllers of a virtual machine or snapshot.
Syntax
Parameter Set: VMName
Get‐VMScsiController [‐VMName] <String[]> [[‐ControllerNumber] <Int32> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMScsiController [‐VM] <VirtualMachine[]> [[‐ControllerNumber] <Int32> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get‐VMScsiController [‐VMSnapshot] <VMSnapshot> [[‐ControllerNumber] <Int32> ] [ <CommonParameters>]
Detailed Description
The Get‐VMScsiController cmdlet gets the SCSI controllers of a virtual machine or snapshot.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the SCSI controllers are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable.
The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐ControllerNumber<Int32>
Specifies the number of the SCSI controller to be retrieved.
Aliases none
Required? false
Position? 2
‐VM<VirtualMachine[]>
Specifies the virtual machine whose SCSI controllers are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose SCSI controllers are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSnapshot<VMSnapshot>
Specifies the snapshot whose SCSI controllers are to be retrieved.
Aliases none
Required? true
Position? 1
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.IDEController
Examples
Example 1
Gets SCSI controller 0 from virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMScsiController ‐VMName TestVM ‐ControllerNumber 0
Example 2
Gets the SCSI controllers from virtual machine TestVM on Hyper‐V host Development.
Windows PowerShell
PS C:\> Get‐VM –Name TestVM –ComputerName Development | Get‐VMScsiController
Example 3
Gets the SCSI controllers from snapshot Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMSnapshot –VMName TestVM –Name 'Before applying updates' | Get‐VMScsiController
© 2015 Microsoft
Get‐VMSnapshot
Windows Server 2012 R2 and Windows 8.1
Get‐VMSnapshot
Gets the checkpoints associated with a virtual machine or checkpoint.
Syntax
Parameter Set: Child
Get‐VMSnapshot [[‐Name] <String> ] ‐ChildOf <VMSnapshot> [‐SnapshotType <SnapshotType> ] [ <CommonParameters>]
Parameter Set: Id
Get‐VMSnapshot [‐Id] <Guid> [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: Parent
Get‐VMSnapshot [[‐Name] <String> ] ‐ParentOf <VirtualMachineBase> [‐SnapshotType <SnapshotType> ] [ <CommonParameters>]
Parameter Set: VMName
Get‐VMSnapshot [‐VMName] <String[]> [[‐Name] <String> ] [‐ComputerName <String[]> ] [‐SnapshotType <SnapshotType> ] [ <CommonParameters>]
Parameter Set: VMObject
Get‐VMSnapshot [‐VM] <VirtualMachine[]> [[‐Name] <String> ] [‐SnapshotType <SnapshotType> ] [ <CommonParameters>]
Detailed Description
The Get‐VMSnapshot cmdlet gets the checkpoints associated with a virtual machine or checkpoint.
Note: In Windows Server 2012 R2, virtual machine snapshots were renamed to virtual machine checkpoints. For clarity, this document will refer to virtual machine
snapshots as checkpoints.
Parameters
‐ChildOf<VMSnapshot>
Specifies the checkpoint whose child checkpoints are to be retrieved. This retrieves immediate children only.
Aliases none
Required? true
Position? named
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which checkpoints are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Id<Guid>
Specifies the unique identifier of the virtual machine whose checkpoints are to be retrieved.
Aliases none
Required? true
Position? 1
‐Name<String>
Specifies the name of the checkpoint to be retrieved.
Aliases none
Required? false
Position? 2
‐ParentOf<VirtualMachineBase>
Specifies the checkpoint whose immediate parent checkpoint is to be retrieved.
Aliases none
Required? true
Position? named
‐SnapshotType<SnapshotType>
Specifies the type of the checkpoints to be retrieved. Allowed values are Standard, Recovery, Planned, Missing, Replica, AppConsistentReplica, and SyncedReplica.
Aliases none
Required? false
Position? named
‐VM<VirtualMachine[]>
Specifies the virtual machine whose checkpoints are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine whose checkpoints are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.Snapshot
Examples
Example 1
Gets all checkpoints of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VMSnapshot –VMName TestVM
Example 2
Gets all standard checkpoints of virtual machine TestVM.
Windows PowerShell
PS C:\> Get‐VM –Name TestVM | Get‐VMSnapshot –SnapshotType Standard
Example 3
Gets the immediate parent of checkpoint Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> $snapshot = Get‐VMSnapshot –Name 'Before applying updates' –VMName TestVM
Windows PowerShell
PS C:\> Get‐VMSnapshot –ParentOf $snapshot
Example 4
Gets the immediate child checkpoints of checkpoint Before applying updates of virtual machine TestVM.
Windows PowerShell
PS C:\> $snapshot = Get‐VMSnapshot –Name 'Before applying updates' –VMName TestVM
Windows PowerShell
PS C:\> Get‐VMSnapshot –ChildOf $snapshot
© 2015 Microsoft
Get‐VMStoragePath
Windows Server 2012 R2 and Windows 8.1
Get‐VMStoragePath
Gets the storage paths in a storage resource pool.
Syntax
Parameter Set: Default
Get‐VMStoragePath [[‐Path] <String[]> ] [‐ResourcePoolName] <String[]> [‐ResourcePoolType] <VMResourcePoolType> [‐ComputerName <String[]> ]
Detailed Description
The Get‐VMStoragePath cmdlet gets the storage paths in a storage resource pool.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which storage paths are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
Accept Pipeline Input? false
‐Path<String[]>
Specifies the path for which matching storage paths are to be retrieved.
Aliases none
Required? false
Position? 1
‐ResourcePoolName<String[]>
Specifies the name of the resource pool for which storage paths are to be retrieved.
Aliases none
Required? true
Position? 2
‐ResourcePoolType<VMResourcePoolType>
Specifies the type of the resource pool for which storage paths are to be retrieved. Valid values are:
‐‐ Memory
‐‐ Processor
‐‐ Ethernet
‐‐ VHD
‐‐ ISO
‐‐ VFD
‐‐ FibreChannelPort
‐‐ FibreChannelConnection
Aliases none
Required? true
Position? 3
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
System.String
Examples
Example 1
Gets the storage paths from virtual hard drive resource pool VHD1.
Windows PowerShell
PS C:\> Get‐VMStoragePath ‐ResourcePoolName VHD1 ‐ResourcePoolType VHD
© 2015 Microsoft
Get‐VMSwitch
Windows Server 2012 R2 and Windows 8.1
Get‐VMSwitch
Gets virtual switches from one or more virtual Hyper‐V hosts.
Syntax
Parameter Set: Name
Get‐VMSwitch [[‐Name] <String> ] [[‐ResourcePoolName] <String[]> ] [‐ComputerName <String[]> ] [‐SwitchType <VMSwitchType[]> ] [ <CommonPar
Parameter Set: Id
Get‐VMSwitch [[‐Id] <Guid[]> ] [[‐ResourcePoolName] <String[]> ] [‐ComputerName <String[]> ] [‐SwitchType <VMSwitchType[]> ] [ <CommonParam
Detailed Description
The Get‐VMSwitch gets the virtual switches from a Hyper‐V host. If you specify no parameters, this cmdlet returns all virtual switches from the local Hyper‐V host.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts from which virtual switches are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
Default Value .
‐Id<Guid[]>
Specifies the unique identifier of the virtual switch to be retrieved.
Aliases SwitchId
Required? false
Position? 1
‐Name<String>
Specifies the name of the virtual switch to be retrieved.
Aliases SwitchName
Required? false
Position? 1
‐ResourcePoolName<String[]>
Specifies the resource pool from which the virtual switches are to be retrieved.
Aliases none
Required? false
Position? 2
‐SwitchType<VMSwitchType[]>
Specifies the type of the virtual switches to be retrieved. Allowed values are External, Internal, and Private.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.EthernetSwitch
Examples
Example 1
Gets all virtual switches from the local Hyper‐V host.
Windows PowerShell
PS C:\> Get‐VMSwitch
Example 2
Gets all virtual switches that connect to the external network.
Windows PowerShell
PS C:\> Get‐VMSwitch –SwitchType External
© 2015 Microsoft
Get‐VMSwitchExtension
Windows Server 2012 R2 and Windows 8.1
Get‐VMSwitchExtension
Gets the extensions on one or more virtual switches.
Syntax
Parameter Set: SwitchName
Get‐VMSwitchExtension [‐VMSwitchName] <String[]> [[‐Name] <String[]> ] [‐ComputerName <String[]> ] [ <CommonParameters>]
Parameter Set: SwitchObject
Get‐VMSwitchExtension [‐VMSwitch] <VMSwitch[]> [[‐Name] <String[]> ] [ <CommonParameters>]
Detailed Description
The Get‐VMSwitchExtension cmdlet gets the extensions on one or more virtual switches. These extensions may be of different types, and may be either enabled or
disabled. Output can be filtered by extension. The retrieved extension object does not contain embedded objects for features, or an array of feature IDs.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the extensions are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names are allowable. The
default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases PSComputerName
Required? false
Position? named
Default Value .
‐Name<String[]>
Specifies the name of the extension to be retrieved.
Aliases none
Required? false
Position? 2
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch from which the extensions are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMSwitchName<String[]>
Specifies the name of the virtual switch from which the extensions are to be retrieved.
Aliases none
Required? true
Position? 1
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Microsoft.HyperV.PowerShell.SwitchExtension
Examples
Example 1
Gets all virtual switch extensions available to the virtual switch InternalSwitch.
Windows PowerShell
PS C:\> Get‐VMSwitch InternalSwitch | Get‐VMSwitchExtension
© 2015 Microsoft
Get‐VMSwitchExtensionPortData
Windows Server 2012 R2 and Windows 8.1
Get‐VMSwitchExtensionPortData
Retrieves the status of a virtual switch extension feature applied to a virtual network adapter.
Syntax
Parameter Set: VMName
Get‐VMSwitchExtensionPortData [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[
Parameter Set: ExternalPort
Get‐VMSwitchExtensionPortData [‐SwitchName] <String> ‐ExternalPort [‐ComputerName <String[]> ] [‐Extension <VMSwitchExtension[]> ] [‐Extens
Parameter Set: ManagementOS
Get‐VMSwitchExtensionPortData ‐ManagementOS [‐ComputerName <String[]> ] [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[]> ] [‐
Parameter Set: ResourceObject
Get‐VMSwitchExtensionPortData [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[]> ]
Parameter Set: VMObject
Get‐VMSwitchExtensionPortData [‐VM] <VirtualMachine[]> [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[]> ] [‐FeatureId <Guid[]
Detailed Description
The Get‐VMSwitchExtensionPortData cmdlet retrieves the status of a virtual switch extension feature applied to a virtual network adapter. This port feature data
surfaces runtime information and statistics on a per‐port basis.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the status of a virtual switch extension applied to a virtual network adapter is to be retrieved. NetBIOS names, IP
addresses, and fully‐qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Extension<VMSwitchExtension[]>
Specifies the virtual switch extension for which status is to be retrieved.
Aliases none
Required? false
Position? named
‐ExtensionName<String[]>
Specifies the name of the virtual switch extension for which status is to be retrieved.
Aliases none
Required? false
Position? named
Aliases none
Required? true
Position? named
‐FeatureId<Guid[]>
Specifies the unique identifier of the feature supported by the virtual switch extension.
Aliases none
Required? false
Position? named
‐FeatureName<String[]>
Specifies the name of the feature supported by the virtual switch extension.
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies that the status is to be retrieved from the management ﴾i.e. parent, or host﴿ operating system.
Aliases none
Required? true
Position? named
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the status to be retrieved.
Aliases none
Required? false
Position? named
‐SwitchName<String>
Specifies the name of the virtual switch.
Aliases none
Required? true
Position? 1
‐VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet gets the status of the virtual switch extension for the virtual machines that you specify. To obtain a virtual
machine object, use the Get‐VM cmdlet.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual machine network adapter.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of the virtual machine network adapter.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets the port feature data with ID eb29f0f2‐f5dc‐45c6‐81bb‐3cd9f219bbbb from the sample forwarding extension on the virtual network adapter in virtual machine VM1.
Windows PowerShell
PS C:\> Get‐VMSwitchExtensionPortData VM1 ‐FeatureId eb29f0f2‐f5dc‐45c6‐81bb‐3cd9f219bbbb
© 2015 Microsoft
Get‐VMSwitchExtensionPortFeature
Windows Server 2012 R2 and Windows 8.1
Get‐VMSwitchExtensionPortFeature
Gets the features configured on a virtual network adapter.
Syntax
Parameter Set: VMName
Get‐VMSwitchExtensionPortFeature [‐VMName] <String[]> [‐ComputerName <String[]> ] [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <Stri
Parameter Set: ExternalPort
Get‐VMSwitchExtensionPortFeature [‐SwitchName] <String> ‐ExternalPort [‐ComputerName <String[]> ] [‐Extension <VMSwitchExtension[]> ] [‐Ext
Parameter Set: ManagementOS
Get‐VMSwitchExtensionPortFeature ‐ManagementOS [‐ComputerName <String[]> ] [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[]> ]
Parameter Set: ResourceObject
Get‐VMSwitchExtensionPortFeature [‐VMNetworkAdapter] <VMNetworkAdapterBase[]> [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[]
Parameter Set: VMObject
Get‐VMSwitchExtensionPortFeature [‐VM] <VirtualMachine[]> [‐Extension <VMSwitchExtension[]> ] [‐ExtensionName <String[]> ] [‐FeatureId <Gui
Detailed Description
The Get‐VMSwitchExtensionPortFeature cmdlet gets the features configured on a virtual network adapter.
Parameters
‐ComputerName<String[]>
Specifies one or more virtual machine hosts on which the features configured on a virtual network adapter are to be retrieved. NetBIOS names, IP addresses, and fully‐
qualified domain names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Extension<VMSwitchExtension[]>
Specifies the virtual switch extension.
Aliases none
Required? false
Position? named
‐ExtensionName<String[]>
Specifies the name of the virtual switch extension.
Aliases none
Required? false
Position? named
‐ExternalPort
Specifies the virtual switch port connected to the external network interface card.
Aliases none
Required? true
Position? named
‐FeatureId<Guid[]>
Specifies the unique identifier of the feature supported by the virtual switch extension.
Aliases none
Required? false
Position? named
Aliases none
Required? false
Position? named
‐ManagementOS
Specifies that the features are to be retrieved from the management ﴾i.e. parent, or host﴿ operating system.
Aliases none
Required? true
Position? named
‐Passthru
Specifies that an object is to be passed through to the pipeline representing the features configured on a virtual switch.
Aliases none
Required? false
Position? named
‐SwitchName<String>
Specifies the name of the virtual switch.
Aliases none
Required? true
Position? 1
‐VM<VirtualMachine[]>
Specifies the virtual machine on which the features configured on a virtual switch are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMName<String[]>
Specifies the name of the virtual machine on which the features configured on a virtual switch are to be retrieved.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the network adapter.
Aliases none
Required? true
Position? 1
‐VMNetworkAdapterName<String>
Specifies the name of the network adapter.
Aliases none
Required? false
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets the feature configured on virtual machine VM2 by name Ethernet Switch Port Security Settings.
Windows PowerShell
PS C:\> Get‐VMSwitchExtensionPortFeature –VMName VM2 –FeatureName "Ethernet Switch Port Security Settings"
© 2015 Microsoft
Get‐VMSwitchExtensionSwitchData
Windows Server 2012 R2 and Windows 8.1
Get‐VMSwitchExtensionSwitchData
Gets the status of a virtual switch extension feature applied on a virtual switch.
Syntax
Parameter Set: SwitchName
Get‐VMSwitchExtensionSwitchData [‐SwitchName] <String[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionSwitchFeature[]> [‐ComputerName <Strin
Parameter Set: SwitchObject
Get‐VMSwitchExtensionSwitchData [‐VMSwitch] <VMSwitch[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionSwitchFeature[]> [‐Extension <VMSwitch
Detailed Description
The Get‐VMSwitchExtensionSwitchData cmdlet gets the status of a virtual switch extension applied on a virtual switch. This switch feature data surfaces runtime
information and statistics on a per‐switch basis.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the status of a virtual switch extension is to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain names
are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Extension<VMSwitchExtension[]>
Specifies the virtual switch extension for which status is to be retrieved.
Aliases none
Required? false
Position? named
‐ExtensionName<String[]>
Specifies the name of the virtual switch extension for which status is to be retrieved.
Aliases none
Required? false
Position? named
‐FeatureId<Guid[]>
Specifies the unique identifier of a feature supported by the virtual switch extension.
Aliases none
Required? false
Position? named
‐FeatureName<String[]>
Specifies the name of a feature supported by the virtual switch extension.
Aliases none
Required? false
Position? named
‐Passthru
Specifies that an Microsoft.HyperV.PowerShell.VMSwitchExtensionSwitchData object is to be passed through to the pipeline representing the virtual switch
extension status.
Aliases none
Required? false
Position? named
‐SwitchName<String[]>
Specifies the name of the virtual switch.
Aliases none
Required? true
Position? 1
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch.
Aliases none
Required? true
Position? 1
‐VMSwitchExtensionFeature<VMSwitchExtensionSwitchFeature[]>
Specifies the virtual switch extension feature.
Aliases none
Required? true
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Gets the switch data from a virtual switch extension that is configured on virtual switch External.
Windows PowerShell
PS C:\> Get‐VMSwitchExtensionSwitchData External –FeatureId 1c37e01c‐0cd6‐496f‐9076‐90c131033dc2
© 2015 Microsoft
Get‐VMSwitchExtensionSwitchFeature
Windows Server 2012 R2 and Windows 8.1
Get‐VMSwitchExtensionSwitchFeature
Gets the features configured on a virtual switch.
Syntax
Parameter Set: SwitchName
Get‐VMSwitchExtensionSwitchFeature [‐SwitchName] <String[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionSwitchFeature[]> [‐ComputerName <St
Parameter Set: SwitchObject
Get‐VMSwitchExtensionSwitchFeature [‐VMSwitch] <VMSwitch[]> ‐VMSwitchExtensionFeature <VMSwitchExtensionSwitchFeature[]> [‐Extension <VMSwi
Detailed Description
The Get‐VMSwitchExtensionSwitchFeature cmdlet gets the features configured on a virtual switch. The object can be used to update the configuration of the switch
using the Set‐VmSwitchExtensionFeature command.
Parameters
‐ComputerName<String[]>
Specifies one or more Hyper‐V hosts on which the features configured on a virtual switch are to be retrieved. NetBIOS names, IP addresses, and fully‐qualified domain
names are allowable. The default is the local computer — use “localhost” or a dot ﴾“.”﴿ to specify the local computer explicitly.
Aliases none
Required? false
Position? named
‐Extension<VMSwitchExtension[]>
Specifies the virtual switch extension.
Aliases none
Required? false
Position? named
‐ExtensionName<String[]>
Specifies the name of the virtual switch extension.
Aliases none
Required? false
Position? named
‐FeatureId<Guid[]>
Specifies the unique identifier of the feature.
Aliases none
Required? false
Position? named
‐FeatureName<String[]>
Specifies the name of the feature.
Aliases none
Required? false
Position? named
‐Passthru
Specifies that a Microsoft.HyperV.PowerShell.VMSwitchExtensionSwitchFeature object is to be passed through to the pipeline representing the features to be
retrieved.
Aliases none
Required? false
Position? named
‐SwitchName<String[]>
Specifies the name of the virtual switch.
Aliases none
Required? true
Position? 1
‐VMSwitch<VMSwitch[]>
Specifies the virtual switch.
Aliases none
Required? true
Position? 1
‐VMSwitchExtensionFeature<VMSwitchExtensionSwitchFeature[]>
Specifies the feature to be retrieved.
Aliases none
Required? true
Position? named
<CommonParameters>
This cmdlet supports the common parameters: ‐Verbose, ‐Debug, ‐ErrorAction, ‐ErrorVariable, ‐OutBuffer, and ‐OutVariable. For more information, see
about_CommonParameters ﴾http://go.microsoft.com/fwlink/p/?LinkID=113216﴿.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
The following command returns all the configured features on the switch named MySwitch.
Windows PowerShell
PS C:\> Get‐VMSwitchExtensionSwitchFeature –SwitchName MySwitch
© 2015 Microsoft