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
4 changes: 4 additions & 0 deletions .codacy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
exclude_paths:
- ".github/instructions/github-actions-ci-cd-best-practices.instructions.md"
- "src/Draft/Remove-OldModule.ps1"
- "src/MarkdownRepair.ps1"
engines:
markdownlint:
exclude_paths:
Expand Down
35 changes: 26 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@

Thanks for your interest in contributing to the **PSPreworkout** module!

Whether it's a bug report, new feature, correction, or additional documentation, your feedback and contributions are appreciated.
Whether it's a bug report, new feature, correction, or additional documentation, your feedback and
contributions are appreciated.

Please read through this document before submitting any issues or pull requests to ensure all the necessary information is provided to effectively respond to your bug report or contribution.
Please read through this document before submitting any issues or pull requests to ensure all the
necessary information is provided to effectively respond to your bug report or contribution.

Please note there is a code of conduct, please follow it in all your interactions with the project.

## Code Style and Standards Conventions

This repository follows best practices and style guidelines that are commonly accepted by the core PowerShell project and by the community at large. We follow the "One True Brace Style" (OTBS) and other practices that are spelled out in detail in [The PowerShell Best Practices and Style Guide](https://github.com/PoshCode/PowerShellPracticeAndStyle). You may also refer to the PowerShell team's [guide to contributing](https://learn.microsoft.com/en-us/powershell/scripting/community/contributing/overview).
This repository follows best practices and style guidelines that are commonly accepted by the core
PowerShell project and by the community at large. We follow the "One True Brace Style" (OTBS) and
other practices that are spelled out in detail in
[The PowerShell Best Practices and Style Guide](https://github.com/PoshCode/PowerShellPracticeAndStyle).
You may also refer to the PowerShell team's
[guide to contributing](https://learn.microsoft.com/en-us/powershell/scripting/community/contributing/overview).

Additional details are described well in this project's [PowerShell instructions](instructions/powershell.instructions.md) file.
Additional details are described well in this project's
[PowerShell instructions](instructions/powershell.instructions.md) file.

## Telemetry during development

Expand All @@ -29,7 +37,8 @@ PSPreworkout commands.

## Automated Module Manifest Updates

When you add a new public function to the module, the build process and GitHub Actions workflows will automatically update the module manifest (`PSPreworkout.psd1`) to include:
When you add a new public function to the module, the build process and GitHub Actions workflows will
automatically update the module manifest (`PSPreworkout.psd1`) to include:

- The function name in `FunctionsToExport`
- Any aliases defined with `[Alias()]` attributes in `AliasesToExport`
Expand All @@ -38,9 +47,12 @@ Aliases should not be added to `FunctionsToExport`.

### How It Works

1. **During Build**: The `UpdateManifest` task in `PSPreworkout.build.ps1` scans all `.ps1` files in the `Public` folder and automatically updates the manifest before testing and building.
1. **During Build**: The `UpdateManifest` task in `PSPreworkout.build.ps1` scans all `.ps1` files in the
`Public` folder and automatically updates the manifest before testing and building.

2. **On Pull Requests**: The "Validate Module Manifest" GitHub Actions workflow checks if any new functions or aliases are missing from the manifest. If any are found, it will automatically commit an update to your PR.
2. **On Pull Requests**: The "Validate Module Manifest" GitHub Actions workflow checks if any new functions
or aliases are missing from the manifest. If any are found, it will automatically commit an update to
your PR.

### Adding a New Function

Expand All @@ -49,6 +61,7 @@ Aliases should not be added to `FunctionsToExport`.
3. Commit and push your changes - the manifest will be updated automatically!

Example:

```powershell
function Get-MyNewFunction {
[CmdletBinding()]
Expand All @@ -59,11 +72,15 @@ function Get-MyNewFunction {
}
```

No manual manifest editing required! The automation will detect `Get-MyNewFunction`, `gmf`, and `Get-MyFunc` and add them to the appropriate sections of the manifest.
No manual manifest editing required! The automation will detect `Get-MyNewFunction`, `gmf`, and
`Get-MyFunc` and add them to the appropriate sections of the manifest.

## Contributing via Pull Requests

Please do not submit changes directly to the main branch. Create a fork of the project and use the `prerelease` branch as your target when submitting a pull request. If you have questions about how to do that, I would be more than happy to walk you through the steps over in the [discussions](https://github.com/SamErde/PSPreworkout/discussions)!
Please do not submit changes directly to the main branch. Create a fork of the project and use the
`prerelease` branch as your target when submitting a pull request. If you have questions about how to
do that, I would be more than happy to walk you through the steps over in the
[discussions](https://github.com/SamErde/PSPreworkout/discussions)!

## Code of Conduct

Expand Down
78 changes: 39 additions & 39 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
---
name: Bug Report
about: Submit a new bug
title: 'πŸͺ² Bug report'
labels: bug
assignees: SamErde
---
<!--- Provide a general summary of the issue in the Title above -->
### Expected Behavior
<!--- Tell us what should happen -->
### Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
### Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
### Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
### Context (Environment)
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Include as many relevant details about the environment where the bug was discovered. -->
* Operating System and version as reported by `$PSVersionTable.OS`:
* PowerShell versions as reported by `$PSVersionTable.PSEdition`:
<!--- Provide a general summary of the issue in the Title above -->
### Detailed Description
<!--- Provide a detailed description of the issue you are facing -->
---
name: Bug Report
about: Submit a new bug
title: 'πŸͺ² Bug report'
labels: bug
assignees: SamErde

---

<!--- Provide a general summary of the issue in the Title above -->

## Expected Behavior
<!--- Tell us what should happen -->

## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->

## Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->

1.
2.
3.
4.

## Context (Environment)
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Include as many relevant details about the environment where the bug was discovered. -->
* Operating System and version as reported by `$PSVersionTable.OS`:
* PowerShell versions as reported by `$PSVersionTable.PSEdition`:

<!--- Provide a general summary of the issue in the Title above -->

## Detailed Description
<!--- Provide a detailed description of the issue you are facing -->
40 changes: 20 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
name: Feature Request
about: Suggest an idea for this project
title: 'πŸ™ Feature request'
labels: 'enhancement'
assignees: ''
---
### Description
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
### Describe the solution you'd like
<!--- A clear and concise description of what you want to happen. -->
### Describe any alternatives you've considered
<!--- A clear and concise description of any alternative solutions or features you've considered. -->
### Additional context
<!--- Add any other context or screenshots about the feature request here. -->
---
name: Feature Request
about: Suggest an idea for this project
title: 'πŸ™ Feature request'
labels: 'enhancement'
assignees: ''

---

## Description
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

## Describe the solution you'd like
<!--- A clear and concise description of what you want to happen. -->

## Describe any alternatives you've considered
<!--- A clear and concise description of any alternative solutions or features you've considered. -->

## Additional context
<!--- Add any other context or screenshots about the feature request here. -->
8 changes: 6 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
<!-- If this PR resolves an issue, enter the issue number here. -->

## Description
<!-- Please include a clear description of what your pull request does. Remember to only include one change (or group of tightly related changes) per pull request to make review and testing easier. -->
<!--
Please include a clear description of what your pull request does. Remember to only include one change
(or group of tightly related changes) per pull request to make review and testing easier.
-->

## Checklist

- [ ] πŸ•΅οΈ I have reviewed my code for errors and tested it.
- [ ] 🚩 My pull request does not contain multiple types of changes.
- [ ] πŸ“„ By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.
- [ ] πŸ“„ By submitting this pull request, I confirm that my contribution is made under the terms of the
projects associated license.
3 changes: 2 additions & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ If you discover a vulnerability in PSPreworkout, please follow the _following pr
1. Open a generic bug issue advising you have discovered a vulnerability.
- Avoid sharing specifics or details of the vulnerability in an open GitHub issue.
2. A repo owner will reach out to you to establish a private form of communication.
3. We will evaluate the vulnerability and, if necessary, release a fix or mitigating steps to address it. We will contact you to let you know the outcome, and will credit you in the report.
3. We will evaluate the vulnerability and, if necessary, release a fix or mitigating steps to address it.
We will contact you to let you know the outcome, and will credit you in the report.

Please **do not disclose the vulnerability publicly** until a fix is released!

Expand Down
6 changes: 4 additions & 2 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Support

There is no express or implied warranty provided with this code. Please review and test before using in a production environment.
There is no express or implied warranty provided with this code. Please review and test before using in a
production environment.

If you have any questions, please use the [Discussions](https://github.com/SamErde/PSPreworkout/discussions).

If you have an issue that you believe may be fixable, please [submit an issue](https://github.com/SamErde/PSPreworkout/issues). Pull requests are also always welcomed!
If you have an issue that you believe may be fixable, please
[submit an issue](https://github.com/SamErde/PSPreworkout/issues). Pull requests are also always welcomed!

πŸ™
2 changes: 2 additions & 0 deletions .github/cicd-scripts/Update-MkDocsNavigation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function Get-FunctionCategory {
- Daily Functions: General utility functions for everyday use
#>
[CmdletBinding()]
[OutputType([string])]
param (
[Parameter(Mandatory)]
[string]$FunctionName
Expand Down Expand Up @@ -92,6 +93,7 @@ function Get-CategorizedFunction {
AliasesToExport and are not included in FunctionsToExport.
#>
[CmdletBinding()]
[OutputType([hashtable])]
param (
[Parameter(Mandatory)]
[string]$ManifestPath
Expand Down
27 changes: 19 additions & 8 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# PowerShell Coding Standards
# Copilot Instructions

## PowerShell Coding Standards

- Always use approved PowerShell verbs for function names (get, set, new, start, remove, update, etc.)
- Use Pascal case for all function names, variables, and parameters
- Follow OTBS (One True Brace Style) formatting
Expand All @@ -7,22 +10,25 @@
- Use proper cmdlet binding and parameter validation
- Always include comment-based help for functions

# General Coding Guidelines
## General Coding Guidelines

- Always add meaningful comments for complex logic
- Prefer explicit error handling over silent failures
- Include unit tests for all new functions

# Response Preferences
## Response Preferences

- Include brief explanations of why a particular approach is recommended
- When suggesting refactoring, explain the benefits
- Provide both the solution and alternative approaches when applicable

# Security Guidelines
## Security Guidelines

- Never hardcode credentials or API keys
- Always validate input parameters
- Implement proper authentication and authorization checks

# PowerShell Commit Message Template
## PowerShell Commit Message Template

Generate commit messages for PowerShell projects using this format:

Expand All @@ -31,7 +37,8 @@ Generate commit messages for PowerShell projects using this format:
Follow the GitMoji specifications at <https://conventional-emoji-commits.site/full-specification/specification> for
commit messages. Tailor commit messages for PowerShell development, using the provided types and scopes.

## PowerShell-Specific Types:
### PowerShell-Specific Types

- feat: ✨ New cmdlet, function, or module feature
- fix: πŸ› Bug fix in PowerShell code
- docs: πŸ“š Help documentation, comment-based help
Expand All @@ -46,17 +53,21 @@ commit messages. Tailor commit messages for PowerShell development, using the pr
- packaging: πŸ“¦ Packaging changes, module version updates
- security: πŸ”’ Security-related changes, input validation, authentication

## PowerShell Scopes:
### PowerShell Scopes

- module: Module-level changes
- cmdlet: Specific cmdlet modifications
- function: Function updates
- help: Documentation changes
- manifest: Module manifest updates
- tests: Test-related changes

## Examples:
### Examples

```text
✨ feat(cmdlet): add Get-UserProfile with parameter validation
πŸ› fix(function): resolve Invoke-ApiCall error handling
πŸ“š docs(help): update comment-based help for Set-Configuration
🎨 style(module): apply OTBS formatting and Pascal case
βœ… test(cmdlet): add Pester tests for Get-SystemInfo
```
6 changes: 3 additions & 3 deletions .github/workflows/Auto-Assign.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: πŸ‘·β€β™‚οΈ Auto-Assign Issues and PRs
name: πŸ‘· Auto-Assign Issues and PRs
on:
issues:
types: [opened]
Expand All @@ -20,15 +20,15 @@ jobs:
with:
egress-policy: audit

- name: 'πŸ‘·β€β™‚οΈ Auto-assign Issue'
- name: 'πŸ‘· Auto-assign Issue'
if: github.event_name == 'issues'
uses: pozil/auto-assign-issue@d6e511896e5f1d2408e74db74416647d8ff80c8c # v4.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
numOfAssignee: 1
assignees: ${{ vars.DEFAULT_ISSUE_ASSIGNEE }}
allowSelfAssign: true
- name: 'πŸ‘·β€β™‚οΈ Auto-assign PR'
- name: 'πŸ‘· Auto-assign PR'
if: github.event_name == 'pull_request'
uses: pozil/auto-assign-issue@d6e511896e5f1d2408e74db74416647d8ff80c8c # v4.1.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Build Module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
shell: pwsh
run: .\src\actions_bootstrap.ps1

- name: πŸ‘·β€β™‚οΈ Test and Build
- name: πŸ‘· Test and Build
shell: pwsh
run: Invoke-Build -File .\src\PSPreworkout.build.ps1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Publish Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
shell: pwsh
run: .\src\actions_bootstrap.ps1

- name: πŸ‘·β€β™‚οΈ Build Module
- name: πŸ‘· Build Module
# Run every task except Archive so the module is built and tested first.
shell: pwsh
run: Invoke-Build -Task Clean, ValidateRequirements, ImportModuleManifest, FormattingCheck, Analyze, Test, CreateHelpStart, Build, IntegrationTest -File .\src\PSPreworkout.build.ps1
Expand Down
Loading
Loading