Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to get all records using Invoke-webrequest?/Why Invoke-webrequest returns only first 2000 Records?

$
0
0
invoke-webrequest content returning only 2000 records though it has around 4000 records in web api.
The same url if I give in excel oData Data feed I am getting all the records.

See the below script
Script:
$QueryResult= (Invoke-WebRequest -Uri $ODataURI -UseDefaultCredentials)

[xml]$xmlResult=$QueryResult.content

foreach($obj in $xmlResult.feed.entry.content.properties)
{   
    $Name=$obj.Name;
    $IsAvail=$obj.isAvail.'#text';   
    $PGroup=$obj.PGroup
...
...
}

I am exporting the above result as a CSV file and my CSV file contains only 2000 records. 
But,  $xmlResult.feed.Count --> it Shows 4000 Records.

The same Odata url if I give in excel oData Data feed I am getting all the 4000 records.

So Please help me how can I get all the records using power shell.


Thanks
A Pathfinder..
JoSwa


If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"Best Online Journal


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images