Identify Host Name Type


posted by Tobias Weltner
11-27-2008

Downloads: 342
File size: 220 B
Views: 1,534

Embed
Identify Host Name Type
  1. function Check-Hostname($name) { 
  2.     [System.Uri]::CheckHostName($name
  3.  
  4. Check-Hostname "127.0.0.1" 
  5. Check-Hostname "2001:0:d5c7:a2ca:89e:7bd:a865:5eb6" 
  6. Check-Hostname "www.powershell.com" 
  7. Check-Hostname "///" 
The Function Check-Hostname provides a simple wrapper around the CheckHostName() static method found in System.URI. With it, you can check host names and find out their type. For example, you can distinguish valid DNS names, IPv4- and IPv6 IP addresses.
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.