Q&A on Yours Truly for Microsoft Canadian Developers Connection

by oising 13. February 2009 23:55

A couple of months ago I had a brief Q&A with the cdndevs guys over on blogs.msdn.com. It looks like it went live recently because I’ve been getting stopped in the streets and harassed for a photo etc. No, not really. But if you want to read, take a look over at http://blogs.msdn.com/cdndevs/archive/2009/02/12/mvp-insider-q-a-with-oisin-grehan.aspx ;-)

Tags:

.NET | Microsoft | MVP | PowerShell

Comments (1) -

Andy Schneider
Andy Schneider
2/26/2009 11:28:54 PM #

Hi Oisin,

I am kind of stuck on a SharePoint PowerShell problem. I've used a bunch of your stuff and it works great. Howver, I am trying to figure out how I can pull more than 100 items from a list using Web Services. I have figured out how to successfully use a Caml Query to specify only certain rows, but I am still needing to pull down more than 100 and I cant figure out how the paging works.

Here is what I have for code

function Get-AutoDeployTask {
param
(
[string]$environment = "Development",
[string]$computername = "IADDDEMO01"
)

[xml]$query = @"
<Query>
  <Where>
    <And>
      <Eq>
        <FieldRef Name="Environment"></FieldRef>
        <Value Type="Text">$environment</Value>
      </Eq>
      <Eq>
        <FieldRef Name="ComputerName"></FieldRef>
        <Value Type="Text">$computername</Value>
      </Eq>
     </And>
  </Where>
</Query>
"@
    
    $uri = "http://AndyDemo/sites/Dev/ShowAndy/_vti_bin/Lists.asmx"
    $webservice = New-WebServiceProxy -uri $uri -UseDefaultCredential
    $webservice.url = $uri
    $webService.GetListItems("MyList",$null, $query, $null, $null, $queryOptions, $null)
}

Basically, I really need some help understanding how Paging works using queryOptions and then how to bring in the next set of rows. Any help you could provide would be much appreciated.

All the best, and thanks again for all you do for the PS Community. Great great stuff!

-Andy

Reply

Add comment



  Country flag
biuquote
  • Comment
  • Preview
Loading


About the author

Oisin Grehan lives in Montreal, Canada and builds all sorts of crap for all sorts of people.

Month List

Page List