Created
April 26, 2013 07:46
-
-
Save jtuttas/5465593 to your computer and use it in GitHub Desktop.
ipclass
This file contains hidden or 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
function ipclass ([string]$ip) { | |
[array]$x = $ip.Split(".") | |
if($x[0] -le 127) | |
{ | |
return "A"; | |
} | |
if($x[0] -gt 127 -and $x[0] -le 191) | |
{ | |
return "B"; | |
} | |
if($x[0] -gt 191 -and $x[0] -le 223) | |
{ | |
Return "C" | |
} | |
} | |
cls | |
$ip = Read-Host ("Geben Sie eine IP Adresse an") | |
$result=ipclass($ip) | |
if ($result -eq "A") { | |
Write-Host ("Sie sind in einem großen Netz!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment