From 85214c52fff17a831d90c09e504fdfbf0642fcb2 Mon Sep 17 00:00:00 2001 From: Elston LEWIS Date: Thu, 31 Oct 2024 16:16:49 +0100 Subject: [PATCH] Updated scripts to handle mtu update on interface name change and latest virtio package --- files/windows/scripts/start.ps1 | 14 ++++++++------ scripts/windows/virtio.ps1 | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/files/windows/scripts/start.ps1 b/files/windows/scripts/start.ps1 index 6cb142d..1847ce2 100755 --- a/files/windows/scripts/start.ps1 +++ b/files/windows/scripts/start.ps1 @@ -6,8 +6,8 @@ .NOTES Name of file : start.ps1 Author : Outscale - Date : November 16th, 2023 - Version : 1.7 + Date : November 1st, 2024 + Version : 1.8 #> <# Functions #> @@ -292,13 +292,15 @@ try { WriteLog("*******************************************************************************") WriteLog("Updating MTU Ethernet Configuration") + # Get Ethernet Interface name + $ethernetAdapter = Get-NetAdapter | Where-Object { $_.Status -eq "Up" -and $_.InterfaceDescription -like "*Ethernet*" } | Select-Object -ExpandProperty Name + # Network Interface - Disable-NetAdapterBinding -InterfaceAlias "Ethernet" -ComponentID ms_tcpip6 - Disable-NetAdapterBinding -InterfaceAlias Ethernet -ComponentID ms_tcpip6 + Disable-NetAdapterBinding -InterfaceAlias $ethernetAdapter -ComponentID ms_tcpip6 - $mtu = (Get-NetIPInterface -InterfaceAlias "Ethernet").NlMtu + $mtu = (Get-NetIPInterface -InterfaceAlias $ethernetAdapter).NlMtu if ($mtu -ne 8950) { - Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Jumbo Packet" -DisplayValue "8964" + Set-NetAdapterAdvancedProperty -Name $ethernetAdapter -DisplayName "Jumbo Packet" -DisplayValue "8964" WriteLog("Set-NetIPInterface Ethernet NlMtuBytes 8950") } else { WriteLog("Set-NetIPInterface Ethernet NlMtuBytes 8950 already set") diff --git a/scripts/windows/virtio.ps1 b/scripts/windows/virtio.ps1 index 3bf1f29..a78d9ee 100644 --- a/scripts/windows/virtio.ps1 +++ b/scripts/windows/virtio.ps1 @@ -9,12 +9,12 @@ .NOTES Name of file : virtio.ps1 Author : Outscale - Date : February 3rd, 2022 - Version : 1.0 + Date : November 1st, 2024 + Version : 1.1 #> #VirtIO msi file URL -$MsiURL = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.229-1/virtio-win-gt-x64.msi" +$MsiURL = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.262-2/virtio-win-gt-x64.msi" #Downloaded msi file name $MsiName = "virtio-win.msi"