๐
Networking
Test connectivity, make web requests, and inspect network config.
Connectivity tests
Ping a host
Modern replacement for ping.
Test-Connection -TargetName google.com -Count 4Test a specific TCP port
Check whether a port is open and reachable.
Test-NetConnection -ComputerName example.com -Port 443Resolve a DNS name
Look up the IP addresses for a hostname.
Resolve-DnsName -Name example.comWeb requests and APIs
Download a file
Fetch a file from a URL to disk.
Invoke-WebRequest -Uri "https://example.com/file.zip" -OutFile ".\file.zip"Call a REST API (JSON)
Get JSON and auto-parse it into objects.
Invoke-RestMethod -Uri "https://api.github.com/repos/PowerShell/PowerShell"POST JSON to an API
Send a JSON body with headers.
$body = @{ name = "demo" } | ConvertTo-Json
Invoke-RestMethod -Uri "https://httpbin.org/post" -Method Post -Body $body -ContentType "application/json"Interface and IP configuration
Show network adapters
List all network interfaces and their status.
Get-NetAdapterShow IP addresses
List configured IPv4 addresses.
Get-NetIPAddress -AddressFamily IPv4Show active TCP connections
List established connections and owning process.
Get-NetTCPConnection -State Established