This commit is contained in:
parent
221e17a4de
commit
2244bea32a
@ -105,7 +105,7 @@ If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotCon
|
|||||||
PrefixLength = $ovfPropertyValues['guestinfo.prefixlength']
|
PrefixLength = $ovfPropertyValues['guestinfo.prefixlength']
|
||||||
DefaultGateway = $ovfPropertyValues['guestinfo.gateway']
|
DefaultGateway = $ovfPropertyValues['guestinfo.gateway']
|
||||||
}
|
}
|
||||||
New-NetIPAddress @NewNetIPAddressSplat
|
$IPAddress = New-NetIPAddress @NewNetIPAddressSplat
|
||||||
|
|
||||||
# Wait for network connection to become available
|
# Wait for network connection to become available
|
||||||
$Timestamp, $TimeoutMinutes = (Get-Date), 5
|
$Timestamp, $TimeoutMinutes = (Get-Date), 5
|
||||||
@ -125,7 +125,8 @@ If ((Get-WmiObject -Class 'Win32_NetworkAdapterConfiguration').IPAddress -NotCon
|
|||||||
Start-Sleep -Milliseconds 250
|
Start-Sleep -Milliseconds 250
|
||||||
|
|
||||||
$GetNetIPAddressSplat = @{
|
$GetNetIPAddressSplat = @{
|
||||||
InterfaceAlias = (Get-NetAdapter).Name
|
IPAddress = $ovfPropertyValues['guestinfo.ipaddress']
|
||||||
|
InterfaceIndex = $IPAddress.InterfaceIndex
|
||||||
AddressFamily = 'IPv4'
|
AddressFamily = 'IPv4'
|
||||||
ErrorAction = 'SilentlyContinue'
|
ErrorAction = 'SilentlyContinue'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user