BladeFireLight/WindowsImageTools

Reduce the New-DataVHD minimum size requirement

drstonephd opened this issue · 3 comments

I tried to use New-DataVHD to create a few 5 GB drive, but it generated an error re a minimum size requirement.

Expected Behavior

New-DataVHD should only test that the size is greater than a very small value.

Current Behavior

New-DataVHD is limited to creating OS sized drives when it can be used to create small non-OS drives in addition.

Possible Solution

Convert-Wim2VHD already tests the size [ValidateRange(25GB, 64TB)] to insure it's big enough for a OS. New-DataVHD can have a different range.

Steps to Reproduce (for bugs)

Context

I'm a DBA trying to script the creation of a SQL Server 2017/2019 VM. Hoping to have the VM start, add itself to the domain (in the correct OU somehow), and run powershell to install and configure SQL. BTW, I do not like the sysprep support in SQL. It would have been okay if instances could be renamed and if the post sysprep complete did not take just as long as a normal install.

Your Environment

  • Module version used:
  • Operating System and PowerShell version:

Initialize-VHDPartition is also called and has a lower limit. Perhaps a lower limit of 100MB both New-DaraVHD and Initialize-VHDPartition? BTW, thanks for sharing your code. I'm learning a lot.

thanks for pointing that out.