Partager via


Get-SCVirtualCOMPort

Get-SCVirtualCOMPort

Gets a VMM virtual COM port object.

Syntax

Parameter Set: All
Get-SCVirtualCOMPort -All [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: HardwareProfile
Get-SCVirtualCOMPort -HardwareProfile <HardwareProfile> [ <CommonParameters>]

Parameter Set: Template
Get-SCVirtualCOMPort -VMTemplate <Template> [ <CommonParameters>]

Parameter Set: VM
Get-SCVirtualCOMPort -VM <VM> [ <CommonParameters>]

Detailed Description

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

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.

Parameters

-All

Indicates that this cmdlet retrieves a full list of all subordinate objects independent of the parent object. For example, the command Get-SCVirtualDiskDrive -All retrieves all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-HardwareProfile<HardwareProfile>

Specifies a hardware profile object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VM<VM>

Specifies a virtual machine object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMTemplate<Template>

Specifies a VMM template object used to create virtual machines.

Aliases

Template

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://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.

  • VirtualCOMPort

Notes

  • Requires a VMM virtual machine object, virtual machine template object, or hardware profile object. You can retrieve these objects by using the Get-SCVirtualMachine, Get-SCVMTemplate, and Get-SCHardwareProfile cmdlets, respectively.

Examples

Example 1: Get COM ports from a virtual machine

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

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

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

Example Example 2: Get COM ports from a template.

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

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

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

Example Example 3: Get COM ports from a hardware profile.

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

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

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

Get-SCHardwareProfile

Get-SCVirtualDiskDrive

Get-SCVirtualMachine

Get-SCVMTemplate

Set-SCVirtualCOMPort