Get-Weather

curlでAAの天気予報を表示できちゃう! というのを耳にして、カッチョイイ!! Windowsコンソールでもできないものか?と探していたら・・・ありました。

PowerShellでwttr.inを表示してみる -素敵なおひげですね-

素敵なおひげさん、ありがとうございます。

(curl http://wttr.in/ -UserAgent "curl" ).Content

尚、ConEmuならANSIエスケープシーケンスを標準でサポートしてるので、設定なしでそのまま使えますよ。

更に、PowerShellのプロファイルにGet-Weatherという関数(名前はなんでもいい)を書けば、Get-Weatherで取得できますよ。
%USERPROFILE%DocumentsWindowsPowerShellprofile.ps1

function Get-Weather { return (curl http://wttr.in/ -UserAgent "curl" ).Content }

こんな感じで編集。

導入まとめ

ConEmuインストール

C:> choco install conemu

PowerShellプロファイルを編集
%USERPROFILE%DocumentsWindowsPowerShellprofile.ps1
ConEmuをPowerShellで起動

関連

chubin/wttr.in
https://github.com/chubin/wttr.in

素敵なおひげですね
http://stknohg.hatenablog.jp/entry/2016/02/22/195644