PowerShell : retrieve JSON object by field value

前端 未结 6 2155
说谎
说谎 2020-12-07 15:15

Consider JSON in this format :

\"Stuffs\": [
    {
        \"Name\": \"Darts\",
        \"Type\": \"Fun Stuff\"
    },
    {
        \"Name\": \"Clean Toilet         


        
6条回答
  •  时光取名叫无心
    2020-12-07 16:05

    David Brabant's answer led me to what I needed, with this addition:

    x.Stuffs | where { $_.Name -eq "Darts" } | Select -ExpandProperty Type
    

提交回复
热议问题