locked
Powershell: Get-PhysicalDisk returns incorrect total capacity of Physical Disk RRS feed

  • Question

  • Hi Everyone,

    I am trying to automate expansion of disk space for my file server (Windows Server 2012 R2) using PowerShell script. There are total 10 Physical Disks (1 locally attached and 9 from SAN)

    In order to get the Total Capacity of Physical Disks, I am using a command "Get-PhysicalDisk"

    However, the output of this command shows incorrect sizes for FEW of the Physical Disks.

    For example, if the actual total capacity is 5.81 TB, the command output shows 5.66 TB, which is 150 GB less than actual. Due to this incorrect outputs, I am not able to achieve the further automation process.

    Request someone to provide some clue on why PowerShell "Get-PhysicalDisk" gives incorrect values.

    Thanks,
    Amit Jogi

    Saturday, November 2, 2019 6:30 AM

Answers

  • The physical value and the formatted value are always different. The larger the disk the greater the difference.  Also a SAN may appear as a physical disk but it is usually an array which will not produce the results you expect.

    Contact the vendor of the SAN for more information.

    PowerShell does not calculate anything it just queries the disk and reports.  This is done though WMI classes.


    \_(ツ)_/

    • Marked as answer by Jogi Amit Thursday, November 28, 2019 4:55 AM
    Saturday, November 2, 2019 6:56 AM