Get-VMGuestDisk

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.Note: You should run the virtual machine's guest operating system at least once to make the storage volumes information available.

Syntax

[-DiskPath  <String[]>]
[-Server  <VIServer[]>]
[-VM  <VirtualMachine[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
DiskPath
String[] named
  • wildcards
  • Filters the results based on the file system mount location. For example, "C:\" or "/etc/my-mount-root". This parameter supports wildcards.
    optional
    Server
    VIServer[] named Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.
    optional
    VM
    VirtualMachine[] named
  • pipeline
  • Limits the results to guest disks on the specified virtual machines.

    [-DiskPath  <String[]>]
    [-Server  <VIServer[]>]
    [-VMGuest  <VMGuest[]>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    optional
    DiskPath
    String[] named
  • wildcards
  • Filters the results based on the file system mount location. For example, "C:\" or "/etc/my-mount-root". This parameter supports wildcards.
    optional
    Server
    VIServer[] named Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.
    optional
    VMGuest
    VMGuest[] named
  • pipeline
  • Limits the results to guest disks on the specified virtual machine guests.

    -HardDisk  <HardDisk[]>
    [-DiskPath  <String[]>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    HardDisk
    HardDisk[] named
  • pipeline
  • Limits the results to guest disks that are backed by the specified virtual disks.
    optional
    DiskPath
    String[] named
  • wildcards
  • Filters the results based on the file system mount location. For example, "C:\" or "/etc/my-mount-root". This parameter supports wildcards.

    Output

    VMware.VimAutomation.ViCore.Types.V1.VM.Guest.VMGuestDisk

    Examples


    Example 1

    Get-VMGuestDisk -VM $myVM

    Retrieves all guest disks for a specified virtual machine.

    Example 2

    $myVms | Get-VMGuestDisk -DiskPath "C:\"

    Retrieves all C: drives on a specified set of virtual machines.

    Related Commands

    Feedback

    Was this page helpful?