Jq – A Command-line JSON processor
jq is awesome, a real achievement.<p>At the same time it demonstrates everything that is wrong with traditional shells and what PowerShell gets so right.<p>jq is <i>not</i> a "Unixy" tool in the sense that it should do one thing and do it right. jq implements its own expression language, command processor complete with internal "pipelines". Why would a tool need to do that? find is another utility that does many, many other things than to "find" items: It executes commands, deletes objects etc.<p>Consider this challenge that included parsing json, filtering, projecting and csv-formatting output: <a href="https://news.ycombinator.com/item?id=9438109" rel="nofollow">https://news.ycombinator.com/item?id=9438109</a><p>Several solutions uses jq - to good effect. But the PowerShell solution uses <i>PowerShell</i> expressions to filter, sort and project items.<p>The problem is - at the core - that the traditional command tools are severely restricted by only being able to rely on a text pipeline convention. You cannot parse json and send the "objects" along to another tool. Well, you can, if the json tree is extremely basic - like 2 levels.<p>PowerShell also has a json parser tool: <a href="https://technet.microsoft.com/en-us/library/hh849898.aspx" rel="nofollow">https://technet.microsoft.com/en-us/library/hh849898.aspx</a>. It is called ConvertFrom-Json (follows the verb-noun convention) and is distributed as part of PowerShell (built-in if you want - but that's a misnomer for PowerShell modules).<p>It is extremely simple - it doesn't even take any parameters - it just converts a string (parses it as json) and outputs the object/objects which can be arbitrarily complex. It truly does only one thing. If you want to select specific properties, sort, group etc you do it with other PS tools like select (alias for Select-Object), sort (alias for Sort-Object), group (alias for Group-Object) etc. If you want to convert back to json you use ConvertTo-Json.