Last active
December 18, 2025 04:07
-
-
Save vman/fcf60982ad1db4e53c9b985d498adff7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delegated token for the signed-in user with Files.Read.All + Sites.Read.All | |
| $token = "<ACCESS_TOKEN>" | |
| $body = @{ | |
| queryString = "What is our paternal leave policy?" | |
| dataSource = "sharePoint" | |
| filterExpression = 'path:"https://contoso.sharepoint.com/sites/HR1/"' | |
| resourceMetadata = @("title","author") | |
| maximumNumberOfResults = 4 | |
| } | ConvertTo-Json -Depth 6 | |
| Invoke-RestMethod -Method Post ` | |
| -Uri "https://graph.microsoft.com/v1.0/copilot/retrieval" ` | |
| -Headers @{ Authorization = "Bearer $token"; "Content-Type" = "application/json" } ` | |
| -Body $body | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment