Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Created April 26, 2013 07:46
Show Gist options
  • Save jtuttas/5465593 to your computer and use it in GitHub Desktop.
Save jtuttas/5465593 to your computer and use it in GitHub Desktop.
ipclass
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