0

I'm trying to parse JSON content with the following code:

Invoke-WebRequest -UseBasicParsing -Uri http://localhost/api/foo).Content | ConvertFrom-Json | Select someId

And the output I've like:

someId                                                                      
---------                                                                      
1234                                                     
5678

How I can skip the header in the above output, so I've got only values?

kenorb
  • 155,785
  • 88
  • 678
  • 743

1 Answers1

4

Use Select-Object -ExpandProperty someId. It will only output the value of that variable.

The default is -Property which creates an object with that property, which is why you get the header.

Frode F.
  • 52,376
  • 9
  • 98
  • 114