forked from cloudbase/windows-imaging-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tdc-create-windows-11pro-online-image.ps1
24 lines (19 loc) · 1.26 KB
/
tdc-create-windows-11pro-online-image.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Import-Module .\WinImageBuilder.psm1
Import-Module .\Config.psm1
Import-Module .\UnattendResources\ini.psm1
$ConfigFilePath = ".\config.ini"
# Set the path to the .wim file, which you might need to extract arduously from a higher level archive within the iso...:
Set-IniFileValue -Path (Resolve-Path $ConfigFilePath) -Section "DEFAULT" `
-Key "wim_file_path" `
-Value "C:\git\windows-openstack-imaging-tools\install.wim"
# VirtIO ISO contains all the synthetic drivers for the KVM hypervisor
$virtIOISOPath = "C:\images\virtio.iso"
# Note(avladu): Do not use stable 0.1.126 version because of this bug https://github.com/crobinso/virtio-win-pkg-scripts/issues/10
# Note (atira): Here https://fedorapeople.org/groups/virt/virtio-win/CHANGELOG you can see the changelog for the VirtIO drivers
$virtIODownloadLink = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.141-1/virtio-win-0.1.141.iso"
# Download the VirtIO drivers ISO from Fedora
if (-not(Test-Path -Path $virtIOISOPath -PathType Leaf)) {
(New-Object System.Net.WebClient).DownloadFile($virtIODownloadLink, $virtIOISOPath)
}
# Now create the image
New-WindowsOnlineImage -ConfigFilePath $ConfigFilePath