Created
December 5, 2018 14:05
-
-
Save MirzaMerdovic/ba78d29636c2a04176737643f29b0db5 to your computer and use it in GitHub Desktop.
Powershell script that will resolve you local IP address and persist it to your hosts file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Module -Name 'Carbon' -AllowClobber | |
$ip=get-WmiObject Win32_NetworkAdapterConfiguration|Where {$_.Ipaddress.length -gt 1} | |
$ip.ipaddress[0] | |
Set-HostsEntry -IPAddress $ip.ipaddress[0] -HostName 'home' -Description "Local IP Address" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment