Update host_info.ps1
Changed method for getting IP addresses. Windows built-in VPN IP addresses do not appear in list using Get-WMIObject, causing shared folders to fail.
This commit is contained in:
parent
92762eeb8c
commit
2557e5f3f8
|
@ -1,8 +1,8 @@
|
||||||
$ErrorAction = "Stop"
|
$ErrorAction = "Stop"
|
||||||
|
|
||||||
$net = Get-WmiObject -class win32_NetworkAdapterConfiguration -Filter 'ipenabled = "true"'
|
$net = Get-NetIPAddress
|
||||||
$result = @{
|
$result = @{
|
||||||
ip_addresses = $net.ipaddress
|
ip_addresses = $net.IPAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output $(ConvertTo-Json $result)
|
Write-Output $(ConvertTo-Json $result)
|
||||||
|
|
Loading…
Reference in New Issue