Поделиться через


Get-SCVirtualCOMPort

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

Syntax

All

Get-SCVirtualCOMPort
    [-VMMServer <ServerConnection>]
    [-All]
    [<CommonParameters>]

HardwareProfile

Get-SCVirtualCOMPort
    -HardwareProfile <HardwareProfile>
    [<CommonParameters>]

VM

Get-SCVirtualCOMPort
    -VM <VM>
    [<CommonParameters>]

Template

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

All
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-HardwareProfile

Specifies a hardware profile object.

Parameter properties

Type:HardwareProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

HardwareProfile
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:VM
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VM
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMMServer

Specifies a VMM server object.

Parameter properties

Type:ServerConnection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

All
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Template
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Template

Parameter sets

Template
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

VirtualCOMPort

This cmdlet returns a VirtualCOMPort object.