PowerShell Script to Add IP to Local Host File

The below PowerShell script will Add any IP you like to the Local Windows Host File for name resolving . #!powershell # Setup Key Values ################################### $ServerName = "ad01.knowledgeascent.com' $IPofServerName = "10.100.200.50" $file = "C:\Windows\System32\drivers\etc\hosts" $hostname = $env:computername # Adding the IP to Local Host File ##################################### function add-host([string]$filename, [string]$ip, [string]$hostname) { [...]