Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

【Powershell】jqでselectできない

以下のjqコマンドはbashでは期待通りに動作します。

$ echo '{"items":[{"id":1,"name":"foo"},{"id":2,"name":"テスト"}]}' | jq '.items[] | select(.name == "テスト") | .name'
"テスト"

Powershellでは、期待に反して、何も出力されません。

$ echo '{"items":[{"id":1,"name":"foo"},{"id":2,"name":"テスト"}]}' | jq '.items[] | select(.name == \"テスト\") | .name'
続きを読む