Fixing fix-second-network.ps1

This commit is contained in:
Chris Long
2020-08-05 00:28:30 -07:00
parent 84c29f6739
commit 165ba4ae41
2 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
# Source: https://github.com/StefanScherer/adfs2
param ([String] $ip, [String] $dns, [String] $gateway)
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Running fix-second-network.ps1..."
if ( (Get-NetAdapter | Select-Object -First 1 | Select-Object -ExpandProperty InterfaceDescription).Contains('Red Hat VirtIO')) {
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting Network Configuration for LibVirt interface"
$subnet = $ip -replace "\.\d+$", ""
@@ -18,10 +20,12 @@ if ( (Get-NetAdapter | Select-Object -First 1 | Select-Object -ExpandProperty In
Write-Error "Could not find a interface with subnet $subnet.xx"
}
exit 0
} Else {
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) No VirtIO adapters, moving on..."
}
if (! (Test-Path 'C:\Program Files\VMware\VMware Tools') ) {
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Nothing to do for other providers than VMware."
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) VMware Tools not found, no need to continue. Exiting."
exit 0
}