Optimize-vhd Not Found ^hot^

Or, specifically for the disk image optimization action:

If you are using the modern, blue-icon PowerShell (version 6 or 7), the cmdlet has been renamed to be more compliant with standard naming conventions. optimize-vhd not found

Check available Hyper-V commands:

You cannot optimize a VHD if the system doesn't have the Hyper-V platform enabled. Press Win + R , type optionalfeatures.exe , and hit Enter. Look for Hyper-V . Or, specifically for the disk image optimization action:

If you have tried the solutions above and still see errors, your machine is likely missing the Hyper-V management tools entirely. This is common on fresh installs of Windows 10/11 Pro or if you installed PowerShell via a package manager without the modules. blue-icon PowerShell (version 6 or 7)