title: Getting VHD info using PowerShell
body: <p>Can you help me with my Powershell script? I am fairly new to Powershell but my boss wants me to get this done soon. </p>
  
  <p>For each VM on our HyperVisor (Server 2012) we want the associated VHD files and for each VHD file:<br>
  -   The location of the file<br>
  -   The size of the file (max allowed)<br>
  -   The actual size of the file (current allocated)<br>
  -   The type of allocation: thick or thin<br>
  -   The location of the snapshot file<br>
  -   The size of the snapshot file  </p>
  
  <p>I have come up with this so far (well.. what I've found)(<em>*</em> is our HV name):</p>
  
  <pre><code>Get-VM –ComputerName ***** | 
  Get-VMHardDiskDrive | 
  Select-Object -Property VMName, ComputerName, Path, Filesize, Size, Disktype, Snapshot | 
  Sort-Object -Property VMName 
  </code></pre>
  
  <p>Somehow this doesnt give any output for Filesize, disktype, size and Snapshot..</p>