Weather in PowerShell With Invoke-RestMethod
Fetch a one-line weather summary over HTTP without a browser.
01Command
$ (Invoke-RestMethod "https://wttr.in/Beijing?format=3")02What it does
Invoke-RestMethod performs an HTTP GET and, when the response is plain text, returns it as a string. Pointing it at wttr.in format=3 gives a compact current-conditions line. Because it returns objects for JSON APIs, it is PowerShell's standard web client.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Invoke-RestMethodEvidence: Sends an HTTP request and returns the response as a string or object.
Last verified: 2026-09-20 · Category: Network
06Related solutions
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
The PowerShell-native replacement for netstat: filter connections by state, port, or process and pipe results instead of parsing text.
The modern, scriptable replacement for nslookup: ask for exact record types, hit specific DNS servers, and see TTLs as objects.