-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathesxi9.ps1
More file actions
94 lines (72 loc) · 3.75 KB
/
Copy pathesxi9.ps1
File metadata and controls
94 lines (72 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
##############################################################################################
# Build custom ESXi 9.x ISOs for non HCL hardware
# David Harrop
# March 2025
##############################################################################################
# Set ESXi depot base version
$baseESXiVer = "9"
# Download other VMWare Flings from Broadcom here:
# https://support.broadcom.com/group/ecx/productdownloads?subfamily=Flings&freeDownloads=true1
# Define Fling file names & download links (Adapt these with the versions you wish to use)
$flingUrl = "https://raw.githubusercontent.com/itiligent/ESXi-Custom-ISO/main/9-updates/" # Flings archived here in case they disappear again
$usbNicFling = "ESXi90-VMKUSB-NIC-FLING-84947163_24739691-component.zip"
$realtekNicFling = "VMware-Re-Driver_1.101.01-5vmw.800.1.0.20613240.zip"
# Define the esxi depot zip file name & download link (Adapt these with the versions you wish to use)
# (Download frpm links, or run this script from the same direcrtory as the local source files)
$manualUpdate1 = "VMware-ESXi-9.0.1.0.24957456-depot.zip"
$manualUpdateUrl1 = "https://itiligent-my.sharepoint.com/personal/david_itiligent_com_au/_layouts/15/guestaccess.aspx?share=IQAdHBTN4iY_T5j1krKjg717ATFvXL27Xf2b2oC1TlRs92k&e=oCjTcu&download=1"
Write-Host ""
Write-Host "Preparing local ESXi depot and package files..."
Write-Host ""
echo ""
echo "Downloading $($manualUpdate1) & creating ESXi depot"
1if (!(Test-Path $manualUpdate1)){Invoke-WebRequest -Uri $manualUpdateUrl1 -OutFile $($manualUpdate1)}
Add-EsxSoftwareDepot $manualUpdate1
Start-Sleep 5
$imageProfiles = Get-EsxImageProfile | Where-Object { $_.Name -like "ESXi-$baseESXiVer*-standard*" } | Sort-Object -Property CreationTime -Descending
# Print a list of available profiles to choose from
for ($i = 0; $i -lt $imageProfiles.Count; $i++) {
echo "$($i + 1). $($imageProfiles[$i].Name) - Created on: $($imageProfiles[$i].CreationTime)"
}
# Validate the selection
do {
$selection = [int](Read-Host "Select an ESXi image profile (1-$($imageProfiles.Count))")
} while (-not ($selection -ge 1 -and $selection -le $imageProfiles.Count))
$imageProfile = $imageProfiles[$selection - 1].Name
echo ""
echo "Downloading $imageProfile and exporting to an image bundle "
echo ""
if (!(Test-Path "$($imageProfile).zip")){Export-ESXImageProfile -ImageProfile $imageProfile -ExportToBundle -filepath "$($imageProfile).zip"}
Get-EsxSoftwareDepot | Remove-EsxSoftwareDepot
echo ""
echo "Finished retrieving $imageProfile"
echo ""
if (!(Test-Path $usbNicFling)){Invoke-WebRequest -Method "GET" $flingUrl$($usbNicFling) -OutFile $($usbNicFling)}
if (!(Test-Path $realtekNicFling)){Invoke-WebRequest -Method "GET" $flingUrl$($realtekNicFling) -OutFile $($realtekNicFling)}
echo ""
echo "Adding extra packages to the local depot"
echo ""
Add-EsxSoftwareDepot "$($imageProfile).zip"
Add-EsxSoftwareDepot $usbNicFling
Add-EsxSoftwareDepot $realtekNicFling
echo ""
echo "Creating a custom profile"
echo ""
$newProfileName = $($imageProfile.Replace("standard", "usbnic-realteknic"))
$newProfile = New-EsxImageProfile -CloneProfile $imageProfile -name $newProfileName -Vendor "Itiligent"
Set-EsxImageProfile -ImageProfile $newProfile -AcceptanceLevel CommunitySupported
echo ""
echo "Injecting extra packages into the custom profile"
echo ""
Add-EsxSoftwarePackage -ImageProfile $newProfile -SoftwarePackage "vmkusb-nic-fling" -Force
Add-EsxSoftwarePackage -ImageProfile $newProfile -SoftwarePackage "if-re" -Force
echo ""
echo "Exporting the custom profile to an ISO..."
echo ""
Export-ESXImageProfile -ImageProfile $newProfile -ExportToIso -filepath "$newProfileName.iso" -Force
Get-EsxSoftwareDepot | Remove-EsxSoftwareDepot
$isoPath = "$newProfileName.iso"
echo ""
echo "Build complete!"
echo "Created ISO: $isoPath"
echo ""