Get-MgAllSite Doesn't Respect the Top Parameter
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 Get-MgAllSite cmdlet 开始,将其对 -Top 的处理与 Graph 响应进行比较,后者包含 $top=1 和一个 @odata.nextLink。重现提供的筛选器,并验证该命令只返回一个站点,且不会发出不必要的请求。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I am trying to find the first site with a display name starting with A. The cmdlet ignores the Top parameter (it's also incredibly slow - debug implies that multiple HTTP requests are made to retrieve the sites) and returns all sites with a displayname starting with A.
[array]$Sites = Get-MgAllSite -filter "startsWith(displayName,'A')" -top 1
$Sites.displayName
Azure Automation Runbook Fans
Alain Charnier
Andy's Christmas Party
ALL-IN-1 MAIL
ALL-IN-1 for DOS
Atlanta Restaurants
Ann Conroy (GM Datacenters)
All R &A Users-Everyone is Welcome
Audi e-tron Drivers - Secret Car Plans
All Tenant Member User Accounts
Andrew's Maintenance Planners (Teamwith a
Expected behavior
The expected behavior is that the cmdlet should comply with the Top parameter and return the number of sites specified in the parameter.
How to reproduce
See above.
SDK Version
V2.30
Latest version known to work for scenario above?
No response
Known Workarounds
Use the Graph API request.
Debug output
Status Code:
OK
Headers:
Cache-Control : no-store, no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 4492f3cc-5c24-4167-8b87-e06724efd3ab
client-request-id : a936e6e8-ed31-42f3-9bc3-81bdedfec988
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"002","RoleInstance":"DU2PEPF0004582C"}}
splogid : 7c82c8a1-9074-a000-4211-67c9056cbfb7
odata-version : 4.0
Date : Tue, 23 Sep 2025 09:50:03 GMT
Body:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/sites/microsoft.graph.getAllSites()?$top=1&$filter=startsWith(displayName%2c%27A%27)&$skiptoken=UGFnZWQ9VFJVRSZwX1RpbWVEZWxldGVkPSZwX0lEPTcwNQ",
"value": [
{
"createdDateTime": "2025-01-22T11:19:37Z",
"id": "redmondassociates.sharepoint.com,7b8c30d5-81a2-4582-bd15-d20e5c3091f5,4f47b8eb-8301-4678-b567-e29204a42441",
"name": "Azure Automation Runbook Fans",
"webUrl": "https://redmondassociates.sharepoint.com/sites/Azure.Automation.Fans",
"displayName": "Azure Automation Runbook Fans",
"isPersonalSite": false,
"siteCollection": {
"hostname": "redmondassociates.sharepoint.com"
},
"root": {}
}
]
}
Click to expand log
<Log output here>
Configuration
No response
Other information
$psversiontable
Name Value
PSVersion 7.5.3
PSEdition Core
GitCommitId 7.5.3
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
- 主要语言
- C#
- 星标
- 902
- 派生
- 233
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 29
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-powershell 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
维护者通常 2 天内回复
-
status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 22/100
microsoftgraph/msgraph-sdk-powershell#3822 ·
维护者通常 2 天内回复
-
status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-powershell#3819 ·
维护者通常 2 天内回复
-
Connect-MgGraph on 2.41 crashes when making a connection with cert, fixes when using 2.39 or lower未关闭status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-powershell#3816 ·
维护者通常 2 天内回复
-
status:waiting-for-triage type:feature
难度 4/5 3-5 天 新手友好度 45/100
microsoftgraph/msgraph-sdk-powershell#3806 · 3 条评论 · 3 个 reaction ·
维护者通常 2 天内回复
查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/fluentui-blazor#5427 ·
维护者通常 1 天内回复
-
area:jobads-cv BE mvp P2
难度 2/5 1-3 小时 新手友好度 62/100
klasolsson81/jobbliggaren#2099 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
0 - Backlog Bug
难度 2/5 1-3 小时 新手友好度 62/100
BrighterCommand/Brighter#4581 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
Esri/calcite-dotnet-toolkit#30 · 1 个 reaction ·