Get-MgAllSite Doesn't Respect the Top Parameter
維護者通常 1 天內回覆
還沒有人認領這個 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#
- 星號
- 904
- 分支
- 235
- 平均合併
- 1 天 21 小時
- 30 天內合併 PR
- 18
環境準備
- 提供 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 ·
維護者通常 1 天內回覆
-
Tracking for V3 Upgrade可能已有人在做 @ramsessanchez 於 1 天前認領。 未關閉type:epic
microsoftgraph/msgraph-sdk-powershell#3874 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-powershell#3873 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 57/100
microsoftgraph/msgraph-sdk-powershell#3872 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 55/100
microsoftgraph/msgraph-sdk-powershell#3831 ·
維護者通常 1 天內回覆
查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue
相似的 Issue
-
area: core priority: low type: bug
難度 2/5 1-3 小時 新手友好度 74/100
RicoSuter/Namotion.Interceptor#863 ·
維護者通常 1 天內回覆
-
area-cli
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
0.3.0
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
BrighterCommand/Brighter#4683 ·
維護者通常 1 天內回覆