agentleFS
MicrosoftKnown publishermicrosoft/mggraph-intune-samples/.github/copilot-instructions.md

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.

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
  1. Very specific:

    Copyright header: every .ps1 file must begin with:

    line 13
  2. Very specific:

    Modules: import the specific Microsoft.Graph* submodule(s) the script needs (e.g., Microsoft.Graph.DeviceManagement), not the whole SDK.

    line 23
  3. Very specific:

    Authentication: use Connect-MgGraph with least-privilege scopes.

    line 25
  4. Very specific:

    Run ./scripts/verify.ps1 (PSScriptAnalyzer + header check) before proposing a commit.

    line 34
  5. Distinctive:

    Keep changes small and focused — ideally one sample or fix per PR.

    line 39
  6. Distinctive:

    Don't reformat or refactor unrelated files.

    line 41

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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.Graph and Microsoft.Graph.Beta modules. Match the style of neighbouring scripts in the same folder.
  • Copyright header: every .ps1 file 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-MgGraph with 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.ps1 samples.

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.