Created
December 12, 2025 18:54
-
-
Save SteveL-MSFT/ae3131b6632dcfdf338fa6e11f40913e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $out = @{} | |
| $cpus = Get-CimInstance win32_processor -Property Name,NumberOfCores,MaxClockSpeed,NumberOfEnabledCore | |
| $hyperThreadEnabled = $cpus[0].NumberOfCores -ne $cpus[0].NumberOfEnabledCore | |
| $out.Compute = @{ | |
| Name = $cpus[0].Name | |
| Cores = $cpus[0].NumberOfCores | |
| MaxClockSpeedMHz = $cpus[0].MaxClockSpeed | |
| HyperThreadingEnabled = $hyperThreadEnabled | |
| Count = $cpus.Count | |
| } | |
| $out.Network = @() | |
| $nics = Get-CimInstance Win32_NetworkAdapter -Filter 'NetConnectionStatus = 2' | |
| foreach ($nic in $nics) { | |
| $nicconfig = $nic | Get-CimAssociatedInstance -ResultClassName Win32_NetworkAdapterConfiguration | |
| $out.Network += @{ | |
| Name = $nic.Name | |
| MACAddress = $nicconfig.MACAddress | |
| IPAddresses = $nicconfig.IPAddress | |
| DHCPServer = $nicconfig.DHCPServer | |
| DNSServers = $nicconfig.DNSServerSearchOrder | |
| IPSubnetMasks = $nicconfig.IPSubnet | |
| DefaultGateways = $nicconfig.DefaultIPGateway | |
| } | |
| } | |
| $out | ConvertTo-Json -Depth 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment