Is there an easy way in powershell 3.0 Windows 7 to get the local computer's ipv4 address into a variable?
Here is another solution:
$env:HostIP = ( Get-NetIPConfiguration | Where-Object { $_.IPv4DefaultGateway -ne $null -and $_.NetAdapter.Status -ne "Disconnected" } ).IPv4Address.IPAddress
1.4m articles
1.4m replys
5 comments
56.9k users