Skip to content

Instantly share code, notes, and snippets.

@torgro
Last active October 29, 2015 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torgro/f0e26b7bd418fef6d792 to your computer and use it in GitHub Desktop.
Save torgro/f0e26b7bd418fef6d792 to your computer and use it in GitHub Desktop.
function Get-ReverseIP
{
[cmdletbinding()]
[OutputType([String[]])]
Param(
[Parameter(
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0)]
[string[]]$Ipaddress
)
Begin
{
}
Process
{
foreach($ip in $Ipaddress)
{
$IpArray = $ip -split "\."
[array]::Reverse($IpArray)
$IpArray -join "."
}
}
End
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment