Problem with showing properties of NetIPConfiguration object

I have problem with showing/exporting properties of object: NetIPConfiguration in PS.
I run get-member to show all methods and properties of this object. Result is:

PS H:\> Get-NetIPConfiguration |Get-Member

   TypeName: NetIPConfiguration

Name                 MemberType Definition
----                 ---------- ----------
Equals               Method     bool Equals[System.Object obj]
GetHashCode          Method     int GetHashCode[]
GetType              Method     type GetType[]
ToString             Method     string ToString[]
AllIPAddresses       Property   ciminstance[] AllIPAddresses {get;set;}
ComputerName         Property   string ComputerName {get;set;}
Detailed             Property   bool Detailed {get;set;}
DNSServer            Property   ciminstance[] DNSServer {get;set;}
InterfaceAlias       Property   string InterfaceAlias {get;set;}
InterfaceDescription Property   string InterfaceDescription {get;set;}
InterfaceIndex       Property   int InterfaceIndex {get;set;}
IPv4Address          Property   ciminstance[] IPv4Address {get;set;}
IPv4DefaultGateway   Property   ciminstance[] IPv4DefaultGateway {get;set;}
IPv6Address          Property   ciminstance[] IPv6Address {get;set;}
IPv6DefaultGateway   Property   ciminstance[] IPv6DefaultGateway {get;set;}
IPv6LinkLocalAddress Property   ciminstance[] IPv6LinkLocalAddress {get;set;}
IPv6TemporaryAddress Property   ciminstance[] IPv6TemporaryAddress {get;set;}
NetAdapter           Property   ciminstance NetAdapter {get;set;}
NetIPv4Interface     Property   ciminstance NetIPv4Interface {get;set;}
NetIPv6Interface     Property   ciminstance NetIPv6Interface {get;set;}
NetProfile           Property   ciminstance NetProfile {get;set;}

When I simply use:

PS H:\> Get-NetIPConfiguration
It shows me properties values as follows [changed digits to zeros]:
InterfaceAlias       : Ethernet
InterfaceIndex       : 3
InterfaceDescription : Realtek PCIe GBE Family Controller
IPv4Address          :
IPv6DefaultGateway   :
IPv4DefaultGateway   :
DNSServer            :

However when I use:

PS H:\> get-NetIPConfiguration |select -Property IPv4Address, IPv4DefaultGateway, DNSServer

The result is:

IPv4Address                                   IPv4DefaultGateway                            DNSServer
-----------                                   ------------------                            ---------
{}                               {MSFT_NetRoute [InstanceID = ":8:8:8:9:55?... {MSFT_DNSClientServerAddress [Name = "3", ...

So basically values are missing and instead it shows me something like: "MSFT_NetRoute (InstanceID = “:8:8:8:9:55?..”
The same is when I want to use ConvetTo-Html:

PS H:\> get-NetIPConfiguration |select -Property IPv4Address, IPv4DefaultGateway, DNSServer |ConvertTo-Html

And result:



Now instead of values I have: Microsoft.Management.Infrastructure.CimInstance
Any suggestions ? How should export NetIPConfiguration properties to html - any ideas ?
Appreciate any help in that matter,

Looks like this is one of the confusing scenarios where PowerShell’s default formatting shows you something other than the raw data on the object. You can find what it’s doing when you use the Get-FormatData cmdlet, and dig a bit through the results:

$formatData = Get-FormatData -TypeName NetIPConfiguration

$formatData.FormatViewDefinition[0].Control.Entries.Items.Where({$_.Label -eq 'IPv4DefaultGateway'}).DisplayEntry.Value

# $output = @();
# foreach($Route in $_.IPv4DefaultGateway) {
#     $output += $Route.NextHop;
# }
# $output;

You can find the code used to generate the default output for the other columns the same way. When you pipe the objects to Select-Object, you change the type (as far as PowerShell’s formatting system is concerned), and you wind up seeing the raw object data instead of having it pass through these small formatting expressions. If you wanted to, though, you could copy those bits of code into constructed properties passed to Select-Object. Here’s a quick example for IPv4DefaultGateway:

$properties = @(
        Name = 'IPv4DefaultGateway'; Expression = {
            $output = @();
            foreach($Route in $_.IPv4DefaultGateway) {
                $output += $Route.NextHop;

Get-NetIPConfiguration | Select-Object -Property $properties