Enterprise-grade PowerShell development standards and GitHub Copilot instructions for consistent, secure, and high-quality PowerShell code across teams and projects.
# Use as template repository or clone
git clone https://github.com/fadwen/PowerShell-Copilot-Standards.git
cd PowerShell-Copilot-Standards
# Install standards in your project
./Tools/Install-CopilotStandards.ps1 -ProjectPath "C:\YourProject" -StandardsType "Module"
# Add as submodule
git submodule add https://github.com/fadwen/PowerShell-Copilot-Standards.git .copilot-standards
# Link instructions (Windows)
mklink .github\copilot-instructions.md .copilot-standards\.github\copilot-instructions.md
# Link instructions (Linux/macOS)
ln -s .copilot-standards/.github/copilot-instructions.md .github/copilot-instructions.md
- Main Instructions: Comprehensive enterprise PowerShell standards
- Prompt Files: Quick-access prompts for common tasks
- Variable Prompts: Interactive code generation
- Quality Gates: Automated validation and enforcement
- Community Best Practices: Integrated PowerShell community guidelines
- Enterprise Security: SOX, GDPR, HIPAA compliance frameworks
- Performance Optimization: Memory management and pipeline efficiency
- Testing Standards: Comprehensive Pester testing patterns
- Project Templates: Module, script collection, and application templates
- Validation Scripts: Automated standards compliance checking
- CI/CD Integration: GitHub Actions and Azure DevOps templates
- Troubleshooting Guides: Organized problem-solving documentation
- Enterprise Functions: Complete functions with security, error handling, and documentation
- Module Scaffolding: Full module structure with tests and documentation
- CI/CD Pipelines: Automated quality gates and deployment workflows
- Input Validation: Comprehensive sanitization and validation patterns
- Credential Management: SecretManagement integration and secure handling
- Compliance Frameworks: Built-in SOX, GDPR, and HIPAA compliance
- Security Scanning: Automated vulnerability detection
- Code Analysis: Comprehensive quality assessment tools
- Performance Testing: Automated benchmarking and optimization
- Documentation Standards: Complete comment-based help and README generation
- Community Compliance: PowerShell best practices enforcement
PowerShell-Copilot-Standards/
βββ .github/
β βββ copilot-instructions.md # Main Copilot instructions
β βββ instructions/ # Detailed instruction files
β βββ prompts/ # Quick-access prompts
β βββ workflows/ # CI/CD templates
βββ Documentation/ # Reference materials
βββ Templates/ # Project templates
βββ Tools/ # Setup and validation scripts
βββ Troubleshooting/ # Organized troubleshooting guides
βββ README.md # This file
In VS Code, add to your settings.json:
{
"chat.promptFiles": true,
"github.copilot.chat.codeGeneration.useInstructionFiles": true
}
- Click "Use this template" above
- Create your new repository
- Start developing with standards automatically applied
git submodule add https://github.com/fadwen/PowerShell-Copilot-Standards.git .copilot-standards
./Tools/Install-CopilotStandards.ps1 -ProjectPath "." -StandardsType "Basic"
# Test standards compliance
./Tools/Test-StandardsCompliance.ps1 -Path "."
# Create your first function using Copilot
# In VS Code, type: /new-function
# Use the new-function prompt in Copilot Chat
/new-function
# Copilot will prompt for: function name, purpose, parameters
# Generates complete enterprise-standard function with tests
# Select PowerShell code, then use security-review prompt
/security-review
# Comprehensive security analysis with compliance validation
# Select code that needs optimization
/optimize-performance
# Get specific optimization recommendations with benchmarks
All generated code includes:
- Unit Tests: Pester tests with 80%+ coverage
- Integration Tests: External dependency validation
- Performance Tests: Benchmarking and regression detection
- Security Tests: Input validation and credential handling
- PSScriptAnalyzer: Zero violations with enterprise rules
- Security Scanning: Credential leak and vulnerability detection
- Community Standards: PowerShell best practices compliance
- Documentation: Complete comment-based help validation
Create .instructions.md
files in your project for team-specific standards:
---
applyTo: "**/*.ps1"
---
# Team-specific PowerShell standards
- Use specific naming conventions for your domain
- Include team-specific validation patterns
- Reference team tools and processes
Add custom prompts for your specific use cases:
---
mode: 'agent'
description: 'Creates infrastructure automation function'
---
Create function for infrastructure management with:
- SCOM integration
- ServiceNow ticket correlation
- Active Directory validation
- Implementation Guide: Step-by-step setup and usage
- PowerShell Best Practices: Community standards reference
- Enterprise Extensions: Organization-specific additions
- Prompt Files Guide: How to use and create prompts
- Troubleshooting: Organized problem-solving guides
- Examples: Real-world usage examples
- Create feature branch:
git checkout -b feature/new-standard
- Add instruction files with comprehensive examples
- Include validation tests and documentation
- Submit pull request with impact assessment
- Test changes with real-world scenarios
- Validate backward compatibility
- Update documentation and examples
- Include performance impact analysis
Teams using these standards typically see:
- 40% faster function development
- 60% reduction in code review cycles
- 80% fewer security vulnerabilities
- 90% improvement in documentation completeness
- Code quality scores (PSScriptAnalyzer compliance)
- Security posture improvements
- Development velocity gains
- Team satisfaction ratings
- Issues: Report bugs or request features via GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Documentation: Check the Documentation folder
- Troubleshooting: See organized guides in Troubleshooting folder
For enterprise implementation assistance:
- Implementation consulting
- Custom instruction development
- Team training and onboarding
- Metrics and success tracking
This project is licensed under the MIT License - see the LICENSE file for details.
- PowerShell Community: For establishing excellent best practices and style guidelines
- GitHub Copilot Team: For creating the extensible instruction system
- Enterprise PowerShell Users: For real-world validation and feedback
Ready to transform your PowerShell development with AI-assisted enterprise standards?
π Get Started Now | π Read the Docs | π€ Contribute