You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Computer field in InformationRecord is incorrect on Ubuntu 18.04 container #9526
I see on Windows we use System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties - the API is ported and we could test it and use for all platforms.
Activity
iSazonov commentedon May 3, 2019
We call
GetFullyQualifiedName()fromlibpsl-nativeto get computer name. So a root of the issue is there.PowerShell/src/System.Management.Automation/engine/cmdlet.cs
Line 690 in 3bfca6d
PowerShell/src/System.Management.Automation/engine/InformationRecord.cs
Line 124 in 3bfca6d
PowerShell/src/System.Management.Automation/utils/PsUtils.cs
Line 216 in 3bfca6d
PowerShell/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs
Line 528 in 3bfca6d
PowerShell/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs
Lines 693 to 695 in 3bfca6d
SteveL-MSFT commentedon May 3, 2019
Perhaps if GetFullyQualifiedName() is empty or null, we can fallback to [Environment]::MachineName?
iSazonov commentedon May 3, 2019
Or use
[Environment]::MachineNamedirectly and remove pinvoke?iSazonov commentedon May 3, 2019
I see on Windows we use
System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties- the API is ported and we could test it and use for all platforms.SteveL-MSFT commentedon May 3, 2019
We should probably see if we can get rid of libpsl-native altogether as .NET Core keeps adding more APIs
iSazonov commentedon May 4, 2019
I'd expect the issue on container for ubuntu is not PowerShell issue and should be fixed on container for ubuntu.
I reviewed API that we use on Unix-es - we use the same GetHostName() (and CoreFX) to get host name but getaddrinfo() to get domain name - CoreFX uses GetDomainName()
I think we should follow CoreFX and remove P/Invokes in our code.
iSazonov commentedon May 9, 2019
Aditya Patwardhan (@adityapatwardhan) Can we close the issue?