param( [string]$1, [string]$2, [string]$3 ) function Set-DNS([string]$EnableDHCP,[string]$dns1, [string]$dns2){ $saNetAdapters = Get-NetIPInterface | Where-Object {$_.ConnectionState -eq "Connected"} foreach ($sNetAdapter in $saNetAdapters.ifIndex) { if ($EnableDHCP -eq "eDHCP") { Set-DnsClientServerAddress -InterfaceIndex $sNetAdapter -ResetServerAddresses } else { Set-DnsClientServerAddress -InterfaceIndex $sNetAdapter -ServerAddresses ($dns1, $dns2) } } Clear-DnsClientCache } function Get-NetworkInformation(){ $computer = $env:computername try {…