The following PowerShell one liners give you hostname to IP or vice versa.
In: Power Shell · Tagged with: dns, hostname, ip address, nslookup, PowerShell
Today I needed to validate an IP address after a user types it in to a script. I don’t want to ping or check connectivity, I just want to validate that the format looks like a valid IP address. I looked at various regex expressions which were getting complicated. Then I stumbled upon this little nugget: