I'm a powershell newbie.
If I run Get-NetIPConfiguration -Detailed I can see the IPv4 DHCP status. This is a good start - took me a lot of googling to get this far:
PS C:\Windows\system32> Get-NetIPConfiguration -Detailed
ComputerName : VM-172-26-39-24
InterfaceAlias : Ethernet
InterfaceIndex : 6
InterfaceDescription : Red Hat VirtIO Ethernet Adapter
NetCompartment.CompartmentId : 1
NetCompartment.CompartmentDescription : Default Compartment
NetAdapter.LinkLayerAddress : FA-16-3E-FF-0D-60
NetAdapter.Status : Up
NetProfile.Name : Network
NetProfile.NetworkCategory : Public
NetProfile.IPv6Connectivity : NoTraffic
NetProfile.IPv4Connectivity : Internet
IPv6LinkLocalAddress : fe80::x:x:x:x
IPv4Address : 172.26.39.249
IPv6DefaultGateway :
IPv4DefaultGateway : 172.26.36.1
NetIPv6Interface.NlMTU : 9000
NetIPv4Interface.NlMTU : 9000
NetIPv6Interface.DHCP : Enabled
NetIPv4Interface.DHCP : Disabled
DNSServer : x.x.x.x
x.x.x.x
But if I run something like
Get-NetIPConfiguration -Detailed | select InterfaceAlias,NetIPv4Interface.DHCP
I get an empty field?
PS C:\Windows\system32> Get-NetIPConfiguration -Detailed | `
select InterfaceAlias, NetIPv4Interface.DHCP
InterfaceAlias NetIPv4Interface.DHCP
-------------- ---------------------
Ethernet
Am I doing something wrong?
If I remove the trailing .DHCP ("what's in there?") I see nothing recognisable
PS C:\Windows\system32> Get-NetIPConfiguration -Detailed | select InterfaceAlias, NetIPv4Interface
InterfaceAlias NetIPv4Interface
-------------- ----------------
Ethernet MSFT_NetIPInterface (Name = "@55?55;", CreationClassName = "", SystemCreationClassName = "", SystemName = "")