Can the VMs be moved to the 2022 Hyper-V host then be upgraded there or should they be upgraded before the move?
If the VM's configuration version is not listed as supported for your Hyper-V host OS in the table below, you either have to upgrade the VM configuration version to a newer version or create a new VM of the same generation using the existing virtual hard disks before you can start the VM.
So if using Server 2022 you could easily create a new VM using the existing VHD (copied over)
The command to run the upgrade is "Update-VMVersion <vmname>". If run on version 5 VM, does it upgrade to the latest?
It will upgrade to the current version.
https://learn.microsoft.com/en-us/powershell/module/hyper-v/update-vmversion?view=windowsserver2022-ps
--please don't forget to upvote
and Accept as answer
if the reply is helpful--