Aston-HyperV-Code/Sans titre1.ps1
2021-04-09 11:02:54 +02:00

14 lines
364 B
PowerShell

# IP address or DnsHostName of your Dhcp Server
$dhcpServer = '192.168.8.1'
# Name of the network adapter to enable DHCP on
$routerNetAdapterName = 'Ethernet1'
$dhcpAddress = [Net.Dns]::GetHostEntry($dhcpServer)
if(!$dhcpAddress){
Write-Warning "Unable to identify IP address of [$dhcpServer]"
break
}else{
$dhcpServerIP = $dhcpAddress.AddressList[0]
}