CodexBloom - Programming Q&A Platform

PowerShell 7.3 - implementing Retrieving Network Adapter Information via Get-NetAdapter

👀 Views: 0 💬 Answers: 1 📅 Created: 2025-07-05
PowerShell networking Get-NetAdapter

I'm not sure how to approach I'm wondering if anyone has experience with I've tried everything I can think of but I've looked through the documentation and I'm still confused about I tried several approaches but none seem to work....... I'm having trouble using the `Get-NetAdapter` cmdlet to retrieve specific properties of network adapters on a Windows Server 2022 machine running PowerShell 7.3. I want to filter the output to only show enabled adapters along with their names and statuses, but I'm working with unexpected results. I've tried using the following command: ```powershell Get-NetAdapter | Where-Object { $_.Status -eq 'Up' } | Select-Object Name, Status ``` However, this command returns all adapters, regardless of their status. The output looks correct in the sense that it lists the adapters, but the `Status` field seems to be populated incorrectly. To troubleshoot, I added some debug output: ```powershell Get-NetAdapter | Format-Table -AutoSize ``` This shows that the Status field is correctly identifying the enabled and disabled adapters. Yet when I filter by `Where-Object`, it still returns all adapters. I’ve also checked the output of `Get-NetAdapter` directly without any filters, and it shows the expected results. As a last resort, I tried using the `-IncludeHidden` parameter, thinking it might affect the output: ```powershell Get-NetAdapter -IncludeHidden | Where-Object { $_.Status -eq 'Up' } | Select-Object Name, Status ``` This didn't resolve the scenario either, and I still got all adapters in the final output. Is there a known scenario with `Get-NetAdapter` in PowerShell 7.3 that could be causing this filtering question, or am I missing something in my approach? Any insights would be appreciated! Any help would be greatly appreciated! What am I doing wrong? I'm working with Powershell in a Docker container on CentOS. Any pointers in the right direction? I'm developing on Windows 10 with Powershell. Has anyone dealt with something similar? Any suggestions would be helpful.