Creates a Windows VM for Hyper-V from a Windows-ISO
Currently supported and tested:
BIOS-DiskLayout
VM's run on Hyper-V (DiskLayout: BIOS uses Gen1-VM, UEFI uses Gen2-VM)
. .\Convert-WindowsImage.ps1
Convert-WindowsImage -SourcePath "C:\Temp\windowsServer2019.iso" -VHDFormat "VHDX" -Edition "Windows Server 2019 Standard" -SizeBytes 50GB -DiskLayout "UEFI" -VHDPath "C:\Temp\windowsServer2019.vhdx"
If you don't know the Edition, use -Edition "LIST" and the function will fail, but list all editions in the ISO/WIM-file.
If you change the script for debugging remember to reload the functions
. .\Convert-WindowsImage.ps1
Please open an issue on github, when you found a bug. Run the script with "-Debug" and "-Verbose" options and a Transcript, like:
Start-Transcript
Convert-WindowsImage -.... -Debug -Verbose
Stop-Transcript
Please attach/post the transcript to the issue.
You've guessed it, PR's are welcome.
The script needs
Powershell ISE is currently supported, but will be deprecated in further releases, according microsofts policy. Consider using Visual Studio Code.
The code is licensed under the GPLv3-License since version 21H2.
The code was licensed under the MIT licencse (X11) before version 21H1 as per the original source this implementation is based upon. See LICENSE
for details.