Optimize-VMDisk

1.0.1

This script was written as a way of easily performing the Optimize-VHD cmdlet that cleans up previously used space and defrags dynamic VHD and VHDX drives used by Hyper-V VMs. Because this operation requires that the VM be shutdown and the disk be mounted read only it can take some setup to get the disk in the correct state to optimize it. This script will shutdown th
This script was written as a way of easily performing the Optimize-VHD cmdlet that cleans up previously used space and defrags dynamic VHD and VHDX drives used by Hyper-V VMs. Because this operation requires that the VM be shutdown and the disk be mounted read only it can take some setup to get the disk in the correct state to optimize it. This script will shutdown the VM, mount the disk, optimize the disk, dismount the disk and then start the VM back up. It also provides a report showing the previous, current and amount recovered from the optimization process.
Show more

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Optimize-VMDisk

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Optimize-VMDisk

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2020 Dillon Childers. All rights reserved.

Package Details

Author(s)

  • Dillon Childers

Functions

Optimize-VMDisk

Dependencies

This module has no dependencies.

FileList

Version History

Version Downloads Last updated
1.0.1 (current version) 3,572 7/11/2020
1.0 385 4/11/2020