Weather in PowerShell With Invoke-RestMethod

Fetch a one-line weather summary over HTTP without a browser.

WindowsnetworkapipowershellLow risk
Run (Invoke-RestMethod "https://wttr.in/Beijing?format=3") for a one-line forecast.

01Command

Command
$ (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

RiskLow risk
RequirementsWindows 10/11 with PowerShell 5.1 or PowerShell 7+
!Warning: The request depends on a third-party service and network access; corporate proxies may need -Proxy configured.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Invoke-RestMethod
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Sends an HTTP request and returns the response as a string or object.

Last verified: 2026-09-20 · Category: Network

06Related solutions