agentleFS
Microsoft AzureKnown publisherAzure/Microsoft.AVS.Management/.github/copilot-instructions.md

Microsoft.AVS.Management

Copilot instructions14 starsChanged 9 months agoMITView on GitHub

Azure VMware Solution (AVS) PowerShell toolkit for administering private VMware datacenters on Azure via the AVS Run Command platform. Scripts run on PowerShell 7.4+ with VMware PowerCLI in a Linux container environment. Vendor packages must list Microsoft.AVS.Management as a dependency. Full scripting guidelines: docs/README.md. PR checklist: CONTRIBUTING.md. Pre-established by AVS before script execution: Test packages in a Linux PowerShell container connecting to your datacenter. Follow semver. Use -dev suffix for vendor testing, -preview for opt-in preview. API consumers should reference…

The file

We split this copilot-instructions.md into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every exported function requires [CmdletBinding()] and [AVSAttribute(timeoutMinutes)] (max 60, default 30).

    line 22
  2. Very specific:

    Use Verb-Noun naming per PowerShell guidelines.

    line 23
  3. Distinctive:

    No dynamic or conditional parameters — split into separate cmdlets instead.

    line 25
  4. Distinctive:

    No child processes — find PowerShell-native alternatives.

    line 26
  5. Very specific:

    Never: call Connect-VIServer or Connect-SsoAdminServer in scripts — AVS pre-establishes admin sessions.

    line 30
  6. Very specific:

    Use SecureString / PSCredential for any secrets or credentials — never log them.

    line 34
  7. Very specific:

    Use [AVSSecureFolder] for appliance deployments requiring restricted access.

    line 35
  8. Very specific:

    Use -ErrorAction Stop for fatal errors.

    line 41
  9. Distinctive:

    Test packages in a Linux PowerShell container connecting to your datacenter.

    line 73
  10. Very specific:

    Follow semver. Use -dev suffix for vendor testing, -preview for opt-in preview.

    line 77

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

AVS Run Command — Project Guidelines

Azure VMware Solution (AVS) PowerShell toolkit for administering private VMware datacenters on Azure via the AVS Run Command platform. Scripts run on PowerShell 7.4+ with VMware PowerCLI in a Linux container environment.

Architecture

ModuleRole
Microsoft.AVS.ManagementCore: storage policies, vSAN, encryption, DRS, utility classes
Microsoft.AVS.CDRConservative Dependency Resolver — pins PowerCLI transitive deps to known-good versions
Microsoft.AVS.NFSNFS datastore mount/unmount
Microsoft.AVS.VMFSiSCSI + VMFS datastore lifecycle

Vendor packages must list Microsoft.AVS.Management as a dependency.

Key Guidelines

Full scripting guidelines: docs/README.md. PR checklist: CONTRIBUTING.md.

Function Conventions

  • Every exported function requires [CmdletBinding()] and [AVSAttribute(timeoutMinutes)] (max 60, default 30).
  • Use Verb-Noun naming per PowerShell guidelines.
  • Supported parameter types: String, Double, Boolean, Int32, PSCredential, SecureString.
  • No dynamic or conditional parameters — split into separate cmdlets instead.
  • No child processes — find PowerShell-native alternatives.

Security (Critical)

  • Never call Connect-VIServer or Connect-SsoAdminServer in scripts — AVS pre-establishes admin sessions.
  • Never elevate cloudadmins privileges.
  • Sanitize all String parameters with Limit-WildcardsandCodeInjectionCharacters before use.
  • Validate names against Test-AVSProtectedObjectName before creating/deleting policies or roles.
  • Use SecureString / PSCredential for any secrets or credentials — never log them.
  • Use [AVSSecureFolder] for appliance deployments requiring restricted access.

Error Handling

  • Validate all prerequisites before making changes (fail early).
  • Track changes for rollback on partial failure (see Set-VmfsIscsi in Microsoft.AVS.VMFS for the pattern).
  • Use -ErrorAction Stop for fatal errors; include context in error messages.
  • Wrap error messages with the failing entity: "Failed to configure iSCSI on host $FailedHost: $($_.Exception.Message)"

Output Streams

  • Write-Host for user-facing confirmations; Write-Warning for cautions; Write-Error + throw for failures.
  • Suppress unintended output with Out-Null or variable capture — stray output disrupts other streams.
  • Return structured results via $NamedOutputs hashtable (max 32KB), set with Set-Variable -Name NamedOutputs -Scope Global.

Runtime Environment

Pre-established by AVS before script execution:

VariablePurpose
$VC_ADDRESSvCenter IP (use "vc.$SddcDnsSuffix" for HTTPS instead)
$SddcDnsSuffixDomain suffix of the SDDC
$SddcResourceIdARM ResourceId of the SDDC
$PersistentSecretsHashtable for secrets across executions (stored in KeyVault)
$SSH_Sessions / $SFTP_SessionsLazy dictionaries of hostname → SSH/SFTP sessions
$MOB_ConnectionvCenter MOB connection (requires Management v7.0.170+)

Build & Test

# Run Pester tests
Invoke-Pester -Path ./tests/

# Run PSScriptAnalyzer (CI uses PSGallery ruleset)
Invoke-ScriptAnalyzer -Path ./ -Recurse -Settings PSGallery

Test packages in a Linux PowerShell container connecting to your datacenter.

Versioning

Follow semver. Use -dev suffix for vendor testing, -preview for opt-in preview. API consumers should reference packages as Module@Major.* (e.g., Microsoft.AVS.VMFS@1.*).

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.