question

ChristopherJack-1763 avatar image
0 Votes"
ChristopherJack-1763 asked ChristopherJack-1763 answered

Powershell .length not returning anything

Hi,

I have the following code which populates an object in Powershell

 $products = Invoke-WebRequest -Uri $uri -contentType  "application/json" -Method Get -Headers $headers -UseBasicParsing | ConvertFrom-Json 
 $Length = $products.length
 $Length 

If I add a breakpoint in after $Length Length is set to null however there are 50 elements in $products. If I pause the code and check $products.length in VS it says 50 however Length is returning null and if I just show $products.length nothing shows up on the screen

Any help appreciated

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChristopherJack-1763 avatar image
0 Votes"
ChristopherJack-1763 answered

There was another element before length.. issue resolved.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.