Syntax
Get-VMGuestDisk [[-DiskPath] <String[]>] [-VM <VirtualMachine[]>] [-Server <VIServer[]>] [<CommonParameters>]Related Commands
Detailed Description
This cmdlet retrieves storage volumes as seen by the virtual machines' guest operating systems. Optionally, you can filter the results by the virtual machine or the file system path where the storage volume is mounted. Alternatively, this cmdlet allows retrieving the guest storage volumes, backed by a specified virtual disk.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
DiskPath | String[] | Filters the results based on the file system mount location. For example, "C:\" or "/etc/my-mount-root". This parameter supports wildcards. | false | False | |
HardDisk | HardDisk[] | Limits the results to guest disks that are backed by the specified virtual disks. | true | True | |
Server | VIServer[] | Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet. | false | False | |
VM | VirtualMachine[] | Limits the results to guest disks on the specified virtual machines. | false | True | |
VMGuest | VMGuest[] | Limits the results to guest disks on the specified virtual machine guests. | false | True |
Return Type
VMGuestDisk objects that represent VM guest storage volumes, matching the specified filters.Notes
Examples
-------------------------- Example 1 --------------------------
PS C:\> Get-VMGuestDisk -VM $myVM
Retrieves all guest disks for a specified virtual machine.
-------------------------- Example 2 --------------------------
PS C:\> $myVms | Get-VMGuestDisk -DiskPath "C:\"
Retrieves all C: drives on a specified set of virtual machines.