Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,62 +0,0 @@
|
|||
function Get-IpAddress
|
||||
{
|
||||
[CmdletBinding()]
|
||||
[OutputType([PSCustomObject])]
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=0)]
|
||||
$InputObject
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
function Get-Address ([string]$Address)
|
||||
{
|
||||
if ($Address.IndexOf(".") -ne -1)
|
||||
{
|
||||
$Address, $port = $Address.Split(":")
|
||||
|
||||
[PSCustomObject]@{
|
||||
IPAddress = [System.Net.IPAddress]$Address
|
||||
Port = $port
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($Address.IndexOf("[") -ne -1)
|
||||
{
|
||||
[PSCustomObject]@{
|
||||
IPAddress = [System.Net.IPAddress]$Address
|
||||
Port = ($Address.Split("]")[-1]).TrimStart(":")
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[PSCustomObject]@{
|
||||
IPAddress = [System.Net.IPAddress]$Address
|
||||
Port = $null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Process
|
||||
{
|
||||
$InputObject | ForEach-Object {
|
||||
$address = Get-Address $_
|
||||
$bytes = ([System.Net.IPAddress]$address.IPAddress).GetAddressBytes()
|
||||
[Array]::Reverse($bytes)
|
||||
$i = 0
|
||||
$bytes | ForEach-Object -Begin {[bigint]$decimalIP = 0} `
|
||||
-Process {$decimalIP += [bigint]$_ * [bigint]::Pow(256, $i); $i++} `
|
||||
-End {[PSCustomObject]@{
|
||||
Address = $address.IPAddress
|
||||
Port = $address.Port
|
||||
Hex = "0x$($decimalIP.ToString('x'))"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$ipAddresses = "127.0.0.1","127.0.0.1:80","::1","[::1]:80","2605:2700:0:3::4713:93e3","[2605:2700:0:3::4713:93e3]:80" | Get-IpAddress
|
||||
$ipAddresses
|
||||
|
|
@ -1 +0,0 @@
|
|||
$ipAddresses[5].Address
|
||||
|
|
@ -1 +0,0 @@
|
|||
$ipAddresses | where {$_.Address.AddressFamily -eq "InterNetworkV6" -and $_.Port -ne $null}
|
||||
Loading…
Add table
Add a link
Reference in a new issue