編集

次の方法で共有


Add-VMDvdDrive

Adds a DVD drive to a virtual machine.

Syntax

VMName (Default)

Add-VMDvdDrive
    [-VMName] <String[]>
    [[-ControllerNumber] <Int32>]
    [[-ControllerLocation] <Int32>]
    [[-Path] <String>]
    [-CimSession <CimSession[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential[]>]
    [-ResourcePoolName <String>]
    [-AllowUnverifiedPaths]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMObject

Add-VMDvdDrive
    [-VM] <VirtualMachine[]>
    [[-ControllerNumber] <Int32>]
    [[-ControllerLocation] <Int32>]
    [[-Path] <String>]
    [-ResourcePoolName <String>]
    [-AllowUnverifiedPaths]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMDriveController

Add-VMDvdDrive
    [-VMDriveController] <VMDriveController[]>
    [[-ControllerLocation] <Int32>]
    [[-Path] <String>]
    [-ResourcePoolName <String>]
    [-AllowUnverifiedPaths]
    [-Passthru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Add-VMDvdDrive cmdlet adds a DVD drive to a virtual machine.

Examples

Example 1

Add-VMDvdDrive -VMName Test -Path D:\ISOs\disc1.iso

This example adds a virtual DVD drive using file D:\ISOs\disc1.iso to virtual machine Test.

Example 2

Get-VM Test | Add-VMDvdDrive -ControllerNumber 1

This example adds a virtual DVD drive using controller number 1 to virtual machine Test.

Example 3

Get-VMIdeController -VMName Test | Add-VMDvdDrive -Path E:\

This example adds virtual DVD drives using the IDE controllers from virtual machine Test.

Parameters

-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.

Parameter properties

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

Parameter sets

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

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-ComputerName

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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

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

-ControllerLocation

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.

Parameter properties

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

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ControllerNumber

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.

Parameter properties

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

Parameter sets

VMName
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
VMObject
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Parameter properties

Type:

PSCredential[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-Passthru

Passes the added Microsoft.HyperV.PowerShell.DvdDrive through to the pipeline.

Parameter properties

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

Parameter sets

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

-Path

Specifies the full path to the virtual hard disk file or physical hard disk volume for the added DVD drive.

Parameter properties

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

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourcePoolName

Specifies the friendly name of the ISO resource pool to which this DVD drive is to be associated.

Parameter properties

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

Parameter sets

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

-VM

Specifies the virtual machine to which the DVD drive is to be added.

Parameter properties

Type:

VirtualMachine[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMObject
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMDriveController

Specifies the drive controller to which the DVD drive is to be added.

Parameter properties

Type:

VMDriveController[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMDriveController
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMName

Specifies the name of the virtual machine to which the DVD drive is to be added.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMName
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
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.

Inputs

Microsoft.HyperV.PowerShell.VMDriveController

Microsoft.HyperV.PowerShell.VirtualMachine

Outputs

Microsoft.HyperV.PowerShell.DvdDrive