mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Update BuildFFUVM.ps1
- Bypass VMSwitchIPAddress to VMHostAddress check on systems with a configured NAT setup
This commit is contained in:
@@ -3805,8 +3805,20 @@ if (($VMHostIPAddress) -and ($VMSwitchName)){
|
||||
throw "IP address for -VMSwitchName $VMSwitchName not found. Please check the -VMSwitchName parameter and try again."
|
||||
}
|
||||
if ($VMSwitchIPAddress -ne $VMHostIPAddress) {
|
||||
try {
|
||||
# Bypass the check for systems that could have a Hyper-V NAT switch
|
||||
$null = Get-NetNat -ErrorAction Stop
|
||||
$NetNat = @(Get-NetNat -ErrorAction Stop);
|
||||
} catch {
|
||||
throw "IP address for -VMSwitchName $VMSwitchName is $VMSwitchIPAddress, which does not match the -VMHostIPAddress $VMHostIPAddress. Please check the -VMHostIPAddress parameter and try again."
|
||||
}
|
||||
if ($NetNat.Count -gt 0) {
|
||||
WriteLog "IP address for -VMSwitchName $VMSwitchName is $VMSwitchIPAddress, which does not match the -VMHostIPAddress $VMHostIPAddress!"
|
||||
WriteLog "NAT setup detected, remember to configure NATing if the FFU image can't be captured to the network share on the host."
|
||||
} else {
|
||||
throw "IP address for -VMSwitchName $VMSwitchName is $VMSwitchIPAddress, which does not match the -VMHostIPAddress $VMHostIPAddress. Please check the -VMHostIPAddress parameter and try again."
|
||||
}
|
||||
}
|
||||
WriteLog '-VMSwitchName and -VMHostIPAddress validation complete'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user