Skip to content

Instantly share code, notes, and snippets.

@mataha
Last active October 3, 2022 00:30
Show Gist options
  • Save mataha/979d02597aff82a79197f46243e3b0e5 to your computer and use it in GitHub Desktop.
Save mataha/979d02597aff82a79197f46243e3b0e5 to your computer and use it in GitHub Desktop.
wttr.in in your conhost.exe
weather=(powershell -NoProfile -NonInteractive "[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; $place = [uri]::EscapeUriString($(If ([string]::IsNullOrWhiteSpace('$*')) { "${env:WTTR_LOCATION}" } Else { '$*' })); $weather = (Invoke-WebRequest "wttr.in/${place}?mF" -UseBasicParsing -Method 'Get' -UserAgent 'curl').Content; echo `r ${weather}.Replace($([char] 0x2196), $([char] 0x005C)).Replace($([char] 0x2197), $([char] 0x002F)).Replace($([char] 0x2198), $([char] 0x005C)).Replace($([char] 0x2199), $([char] 0x002F)).Replace($([char] 0x26A1).ToString(), $([char] 0x250C).ToString() + $([char] 0x2518).ToString()).Trim();")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment