mggraph-intune-samples
Copilot instructions279 starsChanged 5 months agoMITView on GitHub
This repository is a set of Microsoft Graph PowerShell SDK samples for managing Microsoft Intune. It is a non-production, learning/reference repo. See AGENTS.md and docs/conventions.md for full context; this file is a quick pointer for Copilot. - Language: Windows PowerShell / PowerShell 7 using the Microsoft.Graph and Microsoft.Graph.Beta modules. Match the style of neighbouring scripts in the same folder. - Copyright header: every .ps1 file must begin with: - Modules: import the specific Microsoft.Graph* submodule(s) the script needs (e.g., Microsoft.Graph.DeviceManagement),…
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this copilot-instructions.md into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Copyright header: every .ps1 file must begin with:
- Very specific: line 23
Modules: import the specific Microsoft.Graph* submodule(s) the script needs (e.g., Microsoft.Graph.DeviceManagement), not the whole SDK.
- Very specific: line 25
Authentication: use Connect-MgGraph with least-privilege scopes.
- Very specific: line 34
Run ./scripts/verify.ps1 (PSScriptAnalyzer + header check) before proposing a commit.
- Distinctive: line 39
Keep changes small and focused — ideally one sample or fix per PR.
- Distinctive: line 41
Don't reformat or refactor unrelated files.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot instructions — mggraph-intune-samples
This repository is a set of Microsoft Graph PowerShell SDK samples for managing Microsoft Intune. It is a non-production, learning/reference repo. See AGENTS.md and docs/conventions.md for full context; this file is a quick pointer for Copilot.
When generating or editing scripts
- Language: Windows PowerShell / PowerShell 7 using the
Microsoft.GraphandMicrosoft.Graph.Betamodules. Match the style of neighbouring scripts in the same folder. Copyright header: every
.ps1file must begin with:<# .COPYRIGHT Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. #>- Modules: import the specific
Microsoft.Graph*submodule(s) the script needs (e.g.,Microsoft.Graph.DeviceManagement), not the whole SDK. - Authentication: use
Connect-MgGraphwith least-privilege scopes; follow the authentication/region comment block used by existing samples. Never hard-code secrets, tenant IDs, client secrets, or certificates. - Safety: these scripts change Intune configuration. Add comments reminding users
to run against a non-production tenant. Take extra care with
*_Remove.ps1/*_Wipe.ps1/*_Delete.ps1samples.
Verifying
Run ./scripts/verify.ps1 (PSScriptAnalyzer + header check) before proposing a
commit.
Pull request guardrails
- Keep changes small and focused — ideally one sample or fix per PR; avoid sweeping unrelated edits.
- Don't reformat or refactor unrelated files.
- Fill in the PR template.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

