Get-SCVirtualCOMPort

Gets a virtual COM port from a virtual machine, a virtual machine template, or a hardware profile.

Syntax

Get-SCVirtualCOMPort
   [-VMMServer <ServerConnection>]
   [-All]
   [<CommonParameters>]
Get-SCVirtualCOMPort
   -HardwareProfile <HardwareProfile>
   [<CommonParameters>]
Get-SCVirtualCOMPort
   -VM <VM>
   [<CommonParameters>]
Get-SCVirtualCOMPort
   -VMTemplate <Template>
   [<CommonParameters>]

Description

The Get-SCVirtualCOMPort cmdlet gets virtual communication (COM) port objects. This cmdlet gets one or both COM ports from a virtual machine object, a virtual machine template object, or a hardware profile object that Virtual Machine Manager (VMM) manages.

A virtual COM port can connect to a physical port on a virtual machine host server, to a text file, or to a named pipe. Each virtual machine, virtual machine template, and hardware profile contains exactly two COM ports.

Examples

Example 1: Get COM ports for a virtual machine

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Get-SCVirtualCOMPort -VM $VM

The first command gets the virtual machine named VM01, and then stores that object in the $VM variable.

The second command gets the virtual COM port objects on VM01, and displays information about these ports.

Example 2: Get COM ports for a template

PS C:\> $VMTemplate = Get-SCVMTemplate | where { $_.Name -eq "VMTemplate01" }
PS C:\> Get-SCVirtualCOMPort -VMTemplate $VMTemplate

The first command gets the virtual machine template named VMTemplate01, and then stores that object in the $VMTemplate variable.

The second command gets the virtual COM port objects for VMTemplate01, and displays information about these ports.

Example 3: Get COM ports for a hardware profile

PS C:\> $HWProfile = Get-SCHardwareProfile | where { $_.Name -eq "NewHWProfile01" }
PS C:\> Get-SCVirtualCOMPort -HardwareProfile $HWProfile

The first command gets the hardware profile named NewHWProfile01, and then stores that object in the $HWProfile variable.

The second command gets the virtual COM port objects for NewHWProfile01, and displays information about these ports.

Parameters

-All

Indicates that this cmdlet gets a full list of subordinate COM ports independent of the parent object.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-HardwareProfile

Specifies a hardware profile object.

Type:HardwareProfile
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VM

Specifies a virtual machine for which this cmdlet gets virtual COM ports. To obtain a virtual machine object, use the Get-SCVirtualMachine cmdlet.

Type:VM
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VMTemplate

Specifies a VMM template that is used to create virtual machines for which this cmdlet gets virtual COM ports. To obtain a VMM template object, use the Get-SCVMTemplate cmdlet.

Type:Template
Aliases:Template
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

VirtualCOMPort

This cmdlet returns a VirtualCOMPort object.