Skip to main content
Saved 5 chars
Source Link
Ty Auvil
  • 483
  • 4
  • 9

PowerShell 6666 61

Variation on Joey's answer:

filter I{([ipaddress]::parse(($_-split'\.')[3..0]-join'.')).address}

PS C:\> '192.168.1.1' | I
3232235777
PS C:\> '10.10.104.36' | I
168454180
PS C:\> '8.8.8.8' | I
134744072

PowerShell 66

Variation on Joey's answer:

filter I{[ipaddress]::parse(($_-split'\.')[3..0]-join'.').address}

PS C:\> '192.168.1.1' | I
3232235777
PS C:\> '10.10.104.36' | I
168454180
PS C:\> '8.8.8.8' | I
134744072

PowerShell 66 61

Variation on Joey's answer:

filter I{([ipaddress](($_-split'\.')[3..0]-join'.')).address}

PS C:\> '192.168.1.1' | I
3232235777
PS C:\> '10.10.104.36' | I
168454180
PS C:\> '8.8.8.8' | I
134744072
Source Link
Ty Auvil
  • 483
  • 4
  • 9

PowerShell 66

Variation on Joey's answer:

filter I{[ipaddress]::parse(($_-split'\.')[3..0]-join'.').address}

PS C:\> '192.168.1.1' | I
3232235777
PS C:\> '10.10.104.36' | I
168454180
PS C:\> '8.8.8.8' | I
134744072