diff --git a/.codacy.yaml b/.codacy.yaml index 49a14f8d..83184c1d 100644 --- a/.codacy.yaml +++ b/.codacy.yaml @@ -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: diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ab25bdf6..afa91b7b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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 @@ -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` @@ -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 @@ -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()] @@ -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 diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 83c4c72c..18cb6349 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -1,39 +1,39 @@ ---- -name: Bug Report -about: Submit a new bug -title: '🪲 Bug report' -labels: bug -assignees: SamErde - ---- - - - -### Expected Behavior - - -### Current Behavior - - -### Possible Solution - - -### Steps to Reproduce - - - -1. -2. -3. -4. - -### Context (Environment) - - -* Operating System and version as reported by `$PSVersionTable.OS`: -* PowerShell versions as reported by `$PSVersionTable.PSEdition`: - - - -### Detailed Description - +--- +name: Bug Report +about: Submit a new bug +title: '🪲 Bug report' +labels: bug +assignees: SamErde + +--- + + + +## Expected Behavior + + +## Current Behavior + + +## Possible Solution + + +## Steps to Reproduce + + + +1. +2. +3. +4. + +## Context (Environment) + + +* Operating System and version as reported by `$PSVersionTable.OS`: +* PowerShell versions as reported by `$PSVersionTable.PSEdition`: + + + +## Detailed Description + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index afbcbb37..0d505820 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,20 @@ ---- -name: Feature Request -about: Suggest an idea for this project -title: '🙏 Feature request' -labels: 'enhancement' -assignees: '' - ---- - -### Description - - -### Describe the solution you'd like - - -### Describe any alternatives you've considered - - -### Additional context - +--- +name: Feature Request +about: Suggest an idea for this project +title: '🙏 Feature request' +labels: 'enhancement' +assignees: '' + +--- + +## Description + + +## Describe the solution you'd like + + +## Describe any alternatives you've considered + + +## Additional context + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a2852645..9518d6bb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,10 +13,14 @@ ## Description - + ## 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. diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 7e9253b7..9c7e07de 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -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! diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index a3b20b24..6bef1b45 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -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! 🙏 diff --git a/.github/cicd-scripts/Update-MkDocsNavigation.ps1 b/.github/cicd-scripts/Update-MkDocsNavigation.ps1 index 5b0b9f46..d139c492 100644 --- a/.github/cicd-scripts/Update-MkDocsNavigation.ps1 +++ b/.github/cicd-scripts/Update-MkDocsNavigation.ps1 @@ -46,6 +46,7 @@ function Get-FunctionCategory { - Daily Functions: General utility functions for everyday use #> [CmdletBinding()] + [OutputType([string])] param ( [Parameter(Mandatory)] [string]$FunctionName @@ -92,6 +93,7 @@ function Get-CategorizedFunction { AliasesToExport and are not included in FunctionsToExport. #> [CmdletBinding()] + [OutputType([hashtable])] param ( [Parameter(Mandatory)] [string]$ManifestPath diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a438f320..161b6495 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -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 @@ -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: @@ -31,7 +37,8 @@ Generate commit messages for PowerShell projects using this format: Follow the GitMoji specifications at 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 @@ -46,7 +53,8 @@ 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 @@ -54,9 +62,12 @@ commit messages. Tailor commit messages for PowerShell development, using the pr - 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 +``` diff --git a/.github/workflows/Auto-Assign.yml b/.github/workflows/Auto-Assign.yml index 91b7b40f..5d282656 100644 --- a/.github/workflows/Auto-Assign.yml +++ b/.github/workflows/Auto-Assign.yml @@ -1,4 +1,4 @@ -name: 👷‍♂️ Auto-Assign Issues and PRs +name: 👷 Auto-Assign Issues and PRs on: issues: types: [opened] @@ -20,7 +20,7 @@ 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: @@ -28,7 +28,7 @@ jobs: 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: diff --git a/.github/workflows/Build Module.yml b/.github/workflows/Build Module.yml index 33bc78c7..8fd0efb8 100644 --- a/.github/workflows/Build Module.yml +++ b/.github/workflows/Build Module.yml @@ -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 diff --git a/.github/workflows/Publish Release.yml b/.github/workflows/Publish Release.yml index 2abff4e5..e3993ba4 100644 --- a/.github/workflows/Publish Release.yml +++ b/.github/workflows/Publish Release.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e086125..160b829e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,21 +65,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), > [!NOTE] > Thanks to [Jorge Suarez](https://github.com/jorgeasaurus) for contributing this version, which adds improvements to `Update-AllTheThings`! Be sure to check out his featured projects: -> +> > ### Intune Hydration Kit -> +> > PowerShell module that bootstraps Microsoft Intune tenants with boilerplate configurations. . -> +> > ### 📸 Intune-Snapshot-Recovery -> +> > Automated backup and restore toolkit for Microsoft Intune tenant configurations using GitHub Actions. -> +> > ### 🍎 PsJamfBackupRestore -> +> > PowerShell-based solution for backing up and restoring Jamf Pro configurations, ensuring business continuity for macOS management. -> +> > ### 💻 MgConsoleGuiGraphSearch -> +> > Interactive Microsoft Graph search tool using console GUI for various Microsoft 365 and Azure AD object types. ## [2.0.0] - 2025-11-26 @@ -98,12 +98,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - Data sent to PostHog analytics service to understand usage patterns and guide development priorities. ### Fixed + - `New-ScriptFromTemplate` - (Thanks to @jdhitsolutions for finding these issues!) - Fix 'Author' parameter that was incorrectly referencing $Name variable. - Fix examples that referenced non-existent 'Parameter' parameter. - `Update-AllTheThings` - SkipChoco alias issue in module manifest. ### Security and Quality + - `Get-PowerShellPortable` - Refactor to be cleaner, more efficient, and better documented. - `Get-CommandHistory` - Refactor for improved command filtering. - Codebase readability improvements. diff --git a/README.md b/README.md index eb9c7a36..eb31da33 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + diff --git a/docs/MKDOCS-NAVIGATION-AUTOMATION.md b/docs/MKDOCS-NAVIGATION-AUTOMATION.md index 15bdfeaf..3eef79ee 100644 --- a/docs/MKDOCS-NAVIGATION-AUTOMATION.md +++ b/docs/MKDOCS-NAVIGATION-AUTOMATION.md @@ -2,11 +2,13 @@ ## Overview -This document describes the automated solution for keeping the MkDocs navigation synchronized with the PowerShell module's exported functions. +This document describes the automated solution for keeping the MkDocs navigation synchronized with the +PowerShell module's exported functions. ## Problem Statement -Previously, the `nav` section in `mkdocs.yml` had to be manually maintained whenever new functions were added to the module. This led to: +Previously, the `nav` section in `mkdocs.yml` had to be manually maintained whenever new functions were +added to the module. This led to: - Missing functions in documentation navigation - Duplicate entries diff --git a/docs/index.md b/docs/index.md index 067ab144..c5db684b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,4 @@ + diff --git a/src/PSPreworkout/Public/Get-ModulesWithUpdate.ps1 b/src/PSPreworkout/Public/Get-ModulesWithUpdate.ps1 index dea6e3db..8bad2093 100644 --- a/src/PSPreworkout/Public/Get-ModulesWithUpdate.ps1 +++ b/src/PSPreworkout/Public/Get-ModulesWithUpdate.ps1 @@ -429,7 +429,7 @@ } else { # Return the list of modules with updates to the host or the pipeline. Write-Host "Found $($ModulesWithUpdates.Count) modules with updates available." -ForegroundColor Yellow - $ModulesWithUpdates + foreach ($ModuleUpdate in $ModulesWithUpdates) { $ModuleUpdate } } } # end process block }