Microsoft hasn't published any approved PRs on their Convert-WindowsImage module in years. This is a more recent version.
Install-Module Hyper-ConvertImage -Scope CurrentUser
$params = @{
SourcePath = "C:\Path\To\Source.iso"
Edition = 1
VhdType = "Dynamic"
VhdFormat = "VHDX"
VhdPath = "C:\Path\To\output.vhdx"
DiskLayout = "UEFI"
SizeBytes = 127gb
}
Convert-WindowsImage @params
$params = @{
SourcePath = "C:\Path\To\Source.iso"
Edition = 1
VhdType = "Dynamic"
VhdFormat = "VHDX"
VhdPath = "C:\Path\To\output.vhdx"
DiskLayout = "UEFI"
SizeBytes = 127gb
UnattendPath = "C:\Path\To\Unattend.xml"
}
Convert-WindowsImage @params