PoshCode Archive  Artifact [f2d29f8c02]

Artifact f2d29f8c02df5e34cf4c2db57ea4f237723606e422db51966acd070968ec35d4:

  • File IP.ps1 — part of check-in [5c945616e6] at 2018-06-10 13:49:30 on branch trunk — :LOL: (user: greg zakharov size: 830)

# encoding: ascii
# api: powershell
# title: IP
# description: :LOL:
# version: 0.1
# author: greg zakharov
# license: CC0
# x-poshcode-id: 5063
# x-archived: 2014-04-13T13:00:17
# x-published: 2014-04-08T11:23:00
#
# while (poshcode.Exists()) {
# Write-PostAtPoshcode ‘Get Twitter RSS Feed’
# }
# Sounds like fantasy crisis those who endlessly duplicate post about Twitter RSS :D
#
<#
# Checking IP address with cmd:
# C:\> ipconfig
#
# Right? But what if you haven't enough rights to launch ipconfig?
# C:\> for /f "tokens=3" %i in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces /s ^| findstr DhcpIP') do @echo %i
#
# With PowerShell
#>
gp HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\* | % {if (($ip = $_.DhcpIPAddress) -ne '0.0.0.0') {$ip}}