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
- Very specific: line 22
Every exported function requires [CmdletBinding()] and [AVSAttribute(timeoutMinutes)] (max 60, default 30).
- Very specific: line 23
Use Verb-Noun naming per PowerShell guidelines.
- Distinctive: line 25
No dynamic or conditional parameters — split into separate cmdlets instead.
- Distinctive: line 26
No child processes — find PowerShell-native alternatives.
- Very specific: line 30
Never: call Connect-VIServer or Connect-SsoAdminServer in scripts — AVS pre-establishes admin sessions.
- Very specific: line 34
Use SecureString / PSCredential for any secrets or credentials — never log them.
- Very specific: line 35
Use [AVSSecureFolder] for appliance deployments requiring restricted access.
- Very specific: line 41
Use -ErrorAction Stop for fatal errors.
- Distinctive: line 73
Test packages in a Linux PowerShell container connecting to your datacenter.
- Very specific: line 77
Follow semver. Use -dev suffix for vendor testing, -preview for opt-in preview.
≈ “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
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
| Module | Role |
Microsoft.AVS.Management | Core: storage policies, vSAN, encryption, DRS, utility classes |
Microsoft.AVS.CDR | Conservative Dependency Resolver — pins PowerCLI transitive deps to known-good versions |
Microsoft.AVS.NFS | NFS datastore mount/unmount |
Microsoft.AVS.VMFS | iSCSI + 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-Nounnaming 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-VIServerorConnect-SsoAdminServerin scripts — AVS pre-establishes admin sessions. - Never elevate
cloudadminsprivileges. - Sanitize all
Stringparameters withLimit-WildcardsandCodeInjectionCharactersbefore use. - Validate names against
Test-AVSProtectedObjectNamebefore creating/deleting policies or roles. - Use
SecureString/PSCredentialfor 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-VmfsIscsiin Microsoft.AVS.VMFS for the pattern). - Use
-ErrorAction Stopfor 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-Hostfor user-facing confirmations;Write-Warningfor cautions;Write-Error+throwfor failures.- Suppress unintended output with
Out-Nullor variable capture — stray output disrupts other streams. - Return structured results via
$NamedOutputshashtable (max 32KB), set withSet-Variable -Name NamedOutputs -Scope Global.
Runtime Environment
Pre-established by AVS before script execution:
| Variable | Purpose |
$VC_ADDRESS | vCenter IP (use "vc.$SddcDnsSuffix" for HTTPS instead) |
$SddcDnsSuffix | Domain suffix of the SDDC |
$SddcResourceId | ARM ResourceId of the SDDC |
$PersistentSecrets | Hashtable for secrets across executions (stored in KeyVault) |
$SSH_Sessions / $SFTP_Sessions | Lazy dictionaries of hostname → SSH/SFTP sessions |
$MOB_Connection | vCenter 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 PSGalleryTest 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.*).
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.

