Export (0) Print
Expand All
Expand Minimize

Test-SCVirtualDiskDrive

Updated: April 29, 2014

Applies To: System Center 2012 R2 Virtual Machine Manager

Test-SCVirtualDiskDrive

Tests an existing virtual hard disk that is attached to a virtual disk drive object.

Syntax

Parameter Set: Default
Test-SCVirtualDiskDrive [-VirtualDiskDrive] <VirtualDiskDrive> [-JobGroup <Guid> ] [-JobVariable <String> ] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]




Detailed Description

The Test-SCVirtualDiskDrive cmdlet tests an existing virtual hard disk that is attached to a virtual disk drive object.

To test a virtual hard disk, the virtual machine on which the virtual hard disk is configured must be in a stopped state.

Parameters

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualDiskDrive<VirtualDiskDrive>

Specifies a virtual disk drive object. You can attach either a virtual hard disk (for a virtual machine on any host) or a pass-through disk (for a virtual machine on a Hyper-V host or an ESX host) to a virtual disk drive object.


Aliases

none

Required?

true

Position?

1

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.

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.

Examples

Example 1: Test a dynamic VHD attached to a fixed-format virtual disk drive on a virtual machine

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

The second command gets the virtual disk drive object that is attached to virtual machine VM03, and then stores the object in the $VirtDiskDrive variable. This example assumes that the virtual machine has only one virtual disk drive object and that the virtual hard disk attached to the virtual disk drive is a dynamic virtual hard disk.

The third command determines whether VM03 is running. If VM03 is running, the command shuts down the virtual machine.

The last command tests the virtual hard disk stored in $VirtDiskDrive.


PS C:\> $VM = Get-SCVirtualMachine -Name "VM03"
PS C:\> $VirtDiskDrive = Get-SCVirtualDiskDrive -VM $VM
PS C:\> If ($VM.Status -eq "Running") {Stop-SCVirtualMachine -VM $VM -Shutdown}
PS C:\> Test-SCVirtualDiskDrive -VirtualDiskDrive $VirtDiskDrive

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft