在powershell 3.0 Windows 7中有没有简单的方法将本地计算机的ipv4地址放入变量中?
最佳答案
这是另一种解决方案:
$env:HostIP = (
Get-NetIPConfiguration |
Where-Object {
$_.IPv4DefaultGateway -ne $null -and
$_.NetAdapter.Status -ne "Disconnected"
}
).IPv4Address.IPAddress
关于windows - Powershell 获取 ipv4 地址到变量中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27277701/