Remove-SCVirtualDVDDrive

Remove-SCVirtualDVDDrive

Removes a virtual DVD drive object from VMM.

構文

Parameter Set: SourceBusAndLunSpecified
Remove-SCVirtualDVDDrive -JobGroup <Guid]> -SourceBus <Byte]> -SourceLUN <Byte]> [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VirtualDVDDriveSpecified
Remove-SCVirtualDVDDrive [-VirtualDVDDrive] <VirtualDVDDrive> [-JobGroup <Guid]> ] [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Remove-SCVirtualDVDDrive cmdlet removes one or more virtual DVD drive objects from a hardware profile, a virtual machine, or a virtual machine template used in a Virtual Machine Manager (VMM) environment. The cmdlet also deletes any .iso file that the virtual DVD drive uses from the file system on the library server.

This cmdlet returns the object upon success, with the property MarkedForDeletion set to TRUE, or returns an error message upon failure.

パラメーター

-JobGroup<Guid]>

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUser<System.String>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-SourceBus<Byte]>

Specifies the source IDE bus for the drive.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-SourceLUN<Byte]>

Specifies the source logical unit number (LUN) for a virtual DVD drive object on an IDE bus.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VirtualDVDDrive<VirtualDVDDrive>

Specifies a virtual DVD drive object.

エイリアス

none

必須?

true

位置は?

1

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • This cmdlet requires a VMM virtual DVD drive object, which can be retrieved by using the Get-SCVirtualDVDDrive cmdlet.

Example 1: Remove a specific virtual DVD drive 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 gets the virtual DVD drive object located on the first slot of the Secondary Channel, specified by Bus 1 and LUN 0, on the IDE bus on VM01, and then stores the virtual DVD drive object in the $DVDDrive variable.

The last command removes the virtual DVD drive object stored in $DVDDrive from VM01 and deletes any .iso file that this virtual DVD drive uses from the file system on the library server.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $DVDDrive = Get-SCVirtualDVDDrive -VM $VM | where { $_.Bus -eq 1 -and $_.LUN -eq 0 }
PS C:\> Remove-SCVirtualDVDDrive -VirtualDVDDrive $DVDDrive

Example 2: Remove the third virtual DVD drive from a virtual machine

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

The second command gets all virtual DVD drive objects connected to VM02, and then stores each virtual DVD drive object in the $DVDDrive object array. This example assumes that VM02 has three virtual DVD drives and therefore the array contains three elements, counting 0 to 2.

The last command passes the third virtual DVD drive stored in $DVDDrive to the Remove-SCVirtualDVDDrive cmdlet. That cmdlet removes the virtual DVD drive object from VM02 and deletes any .iso file used by this virtual DVD drive from the file system on the library server.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM02"
PS C:\> $DVDDrive = Get-SCVirtualDVDDrive -VM $VM
PS C:\> $DVDDrive[2] | Remove-SCVirtualDVDDrive

関連トピック

Get-SCVirtualDVDDrive

New-SCVirtualDVDDrive

Set-SCVirtualDVDDrive

Get-SCVirtualMachine