From 1fadf7e817a716131cd0a36d215c145669904cca Mon Sep 17 00:00:00 2001 From: djpbessems Date: Mon, 22 Feb 2021 09:03:58 +0100 Subject: [PATCH] Apply upstream fix --- scripts/ADCS/payload/Apply-OVFProperties.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ADCS/payload/Apply-OVFProperties.ps1 b/scripts/ADCS/payload/Apply-OVFProperties.ps1 index 5221b77..1347db7 100644 --- a/scripts/ADCS/payload/Apply-OVFProperties.ps1 +++ b/scripts/ADCS/payload/Apply-OVFProperties.ps1 @@ -79,7 +79,7 @@ If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotCon PrefixLength = $ovfPropertyValues['guestinfo.prefixlength'] DefaultGateway = $ovfPropertyValues['guestinfo.gateway'] } - New-NetIPAddress @NewNetIPAddressSplat + $IPAddress = New-NetIPAddress @NewNetIPAddressSplat # Wait for network connection to become available $Timestamp, $TimeoutMinutes = (Get-Date), 5 @@ -99,7 +99,8 @@ If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotCon Start-Sleep -Milliseconds 250 $GetNetIPAddressSplat = @{ - InterfaceAlias = (Get-NetAdapter).Name + IPAddress = $ovfPropertyValues['guestinfo.ipaddress'] + InterfaceIndex = $IPAddress.InterfaceIndex AddressFamily = 'IPv4' ErrorAction = 'SilentlyContinue' }