Get-NetAdapter es el comando PowerShell moderno para obtener información detallada de todos los adaptadores de red: estado, velocidad, dirección MAC, driver y estadísticas. Mucho más rico en datos que ipconfig.
Get-NetAdapter | Format-Table Name, Status, LinkSpeed, MacAddress -AutoSize
Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
Get-NetAdapterStatistics | Select-Object Name, ReceivedBytes, SentBytes, @{N="RX_MB";E={[math]::Round($_.ReceivedBytes/1MB,1)}}, @{N="TX_MB";E={[math]::Round($_.SentBytes/1MB,1)}}
Get-NetIPAddress -InterfaceAlias "Ethernet" | Format-Table
Disable-NetAdapter -Name "Wi-Fi" -Confirm:$false
Enable-NetAdapter -Name "Wi-Fi"
Test-Connection es el equivalente PowerShell de ping, pero devuelve objetos ricos con latencia, TTL y estado detallado, perfectos para scripts de monitoreo.
Test-Connection -ComputerName google.com -Count 4
$hosts = @("google.com", "8.8.8.8", "192.168.1.1", "cerewro.com")
$hosts | ForEach-Object -Parallel {
$result = Test-Connection -ComputerName $_ -Count 2 -Quiet
[PSCustomObject]@{ Host = $_; Alcanzable = $result }
} -ThrottleLimit 4
Test-NetConnection -ComputerName cerewro.com -Port 443 -InformationLevel Detailed