Skip to content

Instantly share code, notes, and snippets.

View Zeroocooloverride's full-sized avatar

ZerocoolOverride Zeroocooloverride

View GitHub Profile
@Zeroocooloverride
Zeroocooloverride / hosts.ps1
Created April 5, 2024 06:13 — forked from markembling/hosts.ps1
Powershell script for adding/removing/viewing entries to the hosts file.
#
# 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) {