Using Invoke-NaVirtualDiskSpaceReclaim to reclaim space on running virtual machines

by NetApp on ‎2013-05-29 10:04 AM

Toolkit 2.4 introduces Invoke-NaVirtualDiskSpaceReclaim to perform space reclamation on VHD and VHDX virtual disks.  The attached script uses Get-NaHyperV and Invoke-NaVirtualDiskSpaceReclaim along with cmdlets from the Hyper-V module to perform space reclamation.

Feel free to modify the script to suit your needs, just be sure to share any cool additions with the community!


This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.