1
我嘗試從列表中的文件夾中獲取文件夾中的某些文件。爲此,我嘗試使用CalmQuery
和RowLimit
,因爲我在該文件夾中有很多文件。CalmQuery <RowLimit>無法正常工作
但是當我執行代碼時,看起來我的行限制不起作用。
$list = $context.Web.Lists.GetByTitle($ListName)
$context.Load($list)
$query = New-Object Microsoft.SharePoint.Client.CamlQuery
$query.ViewXml = "<View Scope='RecursiveAll'> " +
"<RowLimit>5000</RowLimit>"+
"<Query>" +
"<OrderBy>"+
"<FieldRef Name='FileLeafRef' Ascending='True' />"+
"</OrderBy>"+
"<Where>" +
"<Eq>"+
"<FieldRef Name='FileLeafRef' />"+
"<Value Type='File'>EDMS API/APICAL Invoice</Value>"+
"</Eq>"+
"</Where>"+
"</Query>"+
"</View>"
$listItems = $list.getItems($query)
$context.Load($listItems)
$context.ExecuteQuery()
謝謝,現在工作正常。 –