Skip to content

Instantly share code, notes, and snippets.

Nelson LaQuet nelsonlaquet

Block or report user

Report or block nelsonlaquet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
markembling / hosts.ps1
Created Aug 24, 2009
Powershell script for adding/removing/viewing entries to the hosts file.
View hosts.ps1
# Powershell script for adding/removing/showing entries to the hosts file.
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
$file = "C:\Windows\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {
You can’t perform that action at this time.