Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@{
# PSScriptAnalyzer settings for ConnectWiseAutomateAgent
# https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Cmdlets/Invoke-ScriptAnalyzer.md

Severity = @('Error', 'Warning')

ExcludeRules = @(
# Set-CWAAProxy must convert a plain-text proxy password to SecureString
# for storage in the agent's registry configuration. The password originates
# from the user's -ProxyPassword parameter and there is no SecureString path
# through the LabTech agent registry format.
'PSAvoidUsingConvertToSecureStringWithPlainText',

# Repair-CWAA uses Get-CimInstance Win32_Process (not WMI) for process
# command-line matching. Suppress in case older functions trigger this rule.
'PSAvoidUsingWMICmdlet',

# ServerPassword parameters in Install-CWAA and Redo-CWAA accept a pre-encrypted
# LabTech agent password string, not a user credential. The LabTech agent MSI
# expects a plain string via SERVERPASS= argument. SecureString is not applicable.
'PSAvoidUsingPlainTextForPassword',

# Function names use domain-specific plural nouns that are correct:
# Clear-CWAAInstallerArtifacts (multiple files/processes), Get-CWAASettings (multiple values)
'PSUseSingularNouns',

# ConvertFrom-CWAASecurity uses [switch]$Force = $True so it automatically tries
# alternate decryption keys on failure. Many callers rely on this default.
'PSAvoidDefaultValueSwitchParameter'
)

Rules = @{
PSUseCompatibleSyntax = @{
Enable = $True
TargetVersions = @('3.0', '5.1')
}
}
}
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EditorConfig — https://editorconfig.org

root = true

# Default: UTF-8, CRLF (Windows PowerShell project), trim trailing whitespace
[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true

# PowerShell: 4-space indentation (community standard)
[*.{ps1,psm1,psd1}]
indent_style = space
indent_size = 4

# YAML/JSON: 2-space indentation
[*.{yml,yaml,json}]
indent_style = space
indent_size = 2

# XML (MAML help): 2-space indentation
[*.xml]
indent_style = space
indent_size = 2

# Markdown: preserve trailing whitespace (line breaks)
[*.md]
trim_trailing_whitespace = false
36 changes: 36 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env pwsh
# Pre-commit hook for ConnectWiseAutomateAgent
# Runs PSScriptAnalyzer and Pester tests before allowing commits.
#
# Setup: git config core.hooksPath .githooks
# Or: git config --local core.hooksPath .githooks

$ErrorActionPreference = 'Stop'

# Verify required modules are installed
foreach ($moduleName in @('PSScriptAnalyzer', 'Pester')) {
if (-not (Get-Module -ListAvailable -Name $moduleName)) {
Write-Host "Pre-commit: $moduleName module not found. Install it with: Install-Module $moduleName" -ForegroundColor Red
exit 1
}
}

Write-Host '--- Pre-commit: Running PSScriptAnalyzer ---' -ForegroundColor Cyan
$analyzerResults = Invoke-ScriptAnalyzer -Path source -Recurse -Severity Error,Warning -Settings .PSScriptAnalyzerSettings.psd1
if ($analyzerResults) {
Write-Host 'PSScriptAnalyzer found issues:' -ForegroundColor Red
$analyzerResults | Format-Table RuleName, Severity, ScriptName, Line, Message -AutoSize
exit 1
}
Write-Host 'PSScriptAnalyzer: passed' -ForegroundColor Green

Write-Host '--- Pre-commit: Running Pester tests ---' -ForegroundColor Cyan
$testResult = Invoke-Pester Tests\ -ExcludeTag 'Live' -PassThru -Output Minimal
if ($testResult.FailedCount -gt 0) {
Write-Host "Pester: $($testResult.FailedCount) test(s) failed" -ForegroundColor Red
exit 1
}
Write-Host "Pester: $($testResult.PassedCount) tests passed" -ForegroundColor Green

Write-Host '--- Pre-commit: All checks passed ---' -ForegroundColor Green
exit 0
107 changes: 107 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
* Using welcoming and inclusive language
* Being patient with newcomers and those learning

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

This includes:

- GitHub repositories (issues, pull requests, discussions, code reviews)
- Community Slack channels
- Project-related social media
- Email communications

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at:

- **Email:** conduct@christaylor.codes
- **Slack:** @CTaylor on [MSPGeek Slack](https://join.mspgeek.com/)
- **GitHub:** Open a confidential issue via the Security Advisory feature

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence:** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact:** A violation through a single incident or series of actions.

**Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact:** A serious violation of community standards, including sustained inappropriate behavior.

**Consequence:** A temporary ban from any sort of interaction or public communication with the community for a specified period of time. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence:** A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity

## Questions?

If you have questions about this Code of Conduct, please:

1. Review the [Contributor Covenant FAQ](https://www.contributor-covenant.org/faq)
2. Ask in [GitHub Discussions](../../discussions)
3. Contact the maintainers privately

---

**Last Updated:** 2025-01-22
**Version:** 2.1 (Contributor Covenant)
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/ai_task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: AI Task
about: Create a structured task for AI coding agents
title: '[AI] '
labels: 'ai-task, ai-ready'
assignees: ''
---

## Objective
<!-- One-sentence description of what needs to be accomplished -->

## Context
<!-- Background information an AI agent needs to understand the task -->
<!-- Link to related issues, discussions, or documentation -->

## Requirements
<!-- Specific, testable requirements. Use checkboxes. -->

- [ ]
- [ ]
- [ ]

## Acceptance Criteria
<!-- How to verify the task is complete. Be explicit. -->

- [ ] All existing tests pass (`./Tests/test-local.ps1`)
- [ ] PSScriptAnalyzer reports zero errors
- [ ] New/changed functionality has test coverage
- [ ]

## Files to Modify
<!-- List the specific files or areas of the codebase involved -->
<!-- This helps the AI agent scope its work -->

-
-

## Out of Scope
<!-- Explicitly state what this task does NOT include -->

-

## Technical Notes
<!-- Optional: implementation hints, constraints, or design decisions -->

## Related Issues
<!-- Link to related issues or PRs -->

- Related to #
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: 'bug'
assignees: ''
---

## Bug Description
<!-- A clear and concise description of what the bug is -->

## Steps to Reproduce
<!-- Steps to reproduce the behavior -->

1.
2.
3.
4.

## Expected Behavior
<!-- A clear and concise description of what you expected to happen -->

## Actual Behavior
<!-- A clear and concise description of what actually happened -->

## Screenshots
<!-- If applicable, add screenshots to help explain your problem -->

## Environment
<!-- Please complete the following information -->

- **OS**: [e.g., Windows 11, Windows Server 2022]
- **Module Version**: [e.g., 1.0.0]
- **PowerShell Version**: [e.g., 5.1, 7.4.0]
- **Loading Method**: [Gallery (Install-Module) or Direct Download (Invoke-Expression)]
- **Automate Server Version** (if applicable): [e.g., v200.197]

## Additional Context
<!-- Add any other context about the problem here -->

## Possible Solution
<!-- Optional: Suggest a fix or reason for the bug -->

## Related Issues
<!-- Optional: Link to related issues -->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: true
contact_links:
- name: Community Support
url: https://github.com/christaylorcodes/ConnectWiseAutomateAgent/discussions
about: Ask questions and discuss with the community
- name: Documentation
url: https://github.com/christaylorcodes/ConnectWiseAutomateAgent/blob/main/README.md
about: Check out our documentation
- name: Contributing Guide
url: https://github.com/christaylorcodes/ConnectWiseAutomateAgent/blob/main/CONTRIBUTING.md
about: Learn how to contribute to this project
- name: AI Contributor Guide
url: https://github.com/christaylorcodes/ConnectWiseAutomateAgent/blob/main/AGENTS.md
about: Instructions for AI coding agents contributing to this project
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: 'enhancement'
assignees: ''
---

## Feature Description
<!-- A clear and concise description of the feature you'd like to see -->

## Problem Statement
<!-- Is your feature request related to a problem? Please describe -->
<!-- Example: "I'm always frustrated when..." -->

## Proposed Solution
<!-- Describe the solution you'd like -->

## Alternative Solutions
<!-- Describe any alternative solutions or features you've considered -->

## Use Cases
<!-- Describe specific use cases where this feature would be beneficial -->

1.
2.
3.

## Benefits
<!-- What benefits would this feature provide? -->

-
-
-

## Implementation Ideas
<!-- Optional: If you have ideas on how this could be implemented, share them here -->

## Additional Context
<!-- Add any other context, screenshots, or examples about the feature request here -->

## Related Issues/PRs
<!-- Optional: Link to related issues or pull requests -->

## Would you be willing to contribute this feature?
<!-- Let us know if you'd like to help implement this -->

- [ ] Yes, I'd like to contribute
- [ ] No, but I'm happy to help test
- [ ] No, but I can provide more details
Loading
Loading