PowerShell: How To Configure Static IP Address
$nicName='NIC1' $ipaddress='192.168.0.222' $cidrPrefix=24 $defaultGateway='192.168.0.1' $dnsServers=@('8.8.8.8','4.4.2.2') $disableIpv6=$true function setNic($nicName,$ipAddress,$cidrPrefix,$defaultGateway,$dnsServers,$disableIpv6=$true ){ $ifIndex=(get-netadapter|?{$_.Name -eq $nicName}).ifIndex New-NetIPAddress -InterfaceIndex $ifIndex…
0 Comments