Skip to content

Powershell script that keeps your hosts file up to date with your HyperV VMs

License

Notifications You must be signed in to change notification settings

Egorrko/HyperV2Hosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HyperV2Hosts

HyperV2Hosts is a PowerShell script that fetches IP addresses of active Hyper-V VMs and updates your hosts file with VM names and their IPs.
The script adds entries in the hosts file using the format IP VMName # [HYPERV2HOSTS].

Prerequisites

  • Windows operating system with PowerShell
  • Administrator privileges

Usage

  1. Clone or download this repository.

  2. Open PowerShell with administrative privileges.

  3. Navigate to the cloned/downloaded directory:

cd path/to/HyperV2Hosts
  1. Run the script:
.\hyperV2hosts.ps1
  1. Check your hosts file at %SystemRoot%\System32\drivers\etc\hosts to see the updated entries.

Notes


Inspired by hyperv2hosts

Written almost completely using ChatGPT. This README.md too :)

About

Powershell script that keeps your hosts file up to date with your HyperV VMs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published