Refactor: code quality improvements, documentation fixes, and Pester tests#13
Merged
leonardokr merged 7 commits intomainfrom Feb 18, 2026
Merged
Refactor: code quality improvements, documentation fixes, and Pester tests#13leonardokr merged 7 commits intomainfrom
leonardokr merged 7 commits intomainfrom
Conversation
Code quality improvements: - Replace @() += anti-pattern with List<PSObject> in Get-FolderPermissions, New-ShareAndDFS, and Deploy-ScheduledTasks - Modernize New-Object to [PSCustomObject] in Get-FolderPermissions - Add SupportsShouldProcess to Remove-OrphanedProfiles for destructive ops - Parameterize FullAccess "Everyone" in New-ShareAndDFS (-ShareAccess) - Add #Requires -Modules ActiveDirectory to Get-DeletedUsers and Get-UserLastLogon - Add Version field (1.0.0) to .NOTES in all scripts - Add explanatory comment for group name regex in Get-UserLastLogon - Clean up trailing blank lines across all scripts Documentation fixes: - Add CI status badge to root README - Fix missing .ps1 extension for Send-PasswordExpiryNotification in README - Add Invoke-WindowsUpdateMaintenance to root README System section - Fix broken Markdown code fence in ActiveDirectory/README.md - Update ActiveDirectory/README.md examples for new PascalCase params - Fix CONTRIBUTING.md category SystemMaintenance -> System, add Registry - Add maintainer contact link to SECURITY.md - Document sample-servers.csv in System/README.md - Update NetworkShares/README.md to mention -ShareAccess parameter Testing: - Add Tests/ directory with Pester test suite (ScriptValidation.Tests.ps1) - Tests validate syntax, help docs, coding standards, and param declarations - Add Pester to CI pipeline
…AndDFS After merging the bug fix PR, EnableDebugMode is now properly used in the script, making the PSReviewUnusedParameter suppression unnecessary and causing a DiagnosticRecord error in PSScriptAnalyzer.
PSScriptAnalyzer cannot detect usage of ShareAccess inside the nested New-ShareFolder function scope. Adding targeted suppression.
Split by \r?\n instead of \n and match only spaces/tabs (not \r) to avoid false positives from carriage returns on Windows.
- Add missing comma after ShareAccess param in New-ShareAndDFS (syntax error) - Add Version to NOTES in Send-PasswordExpiryNotification and Invoke-WindowsUpdateMaintenance - Remove trailing whitespace in Invoke-WindowsUpdateMaintenance and Remove-OrphanedProfiles
PSScriptAnalyzer cannot detect usage of EnableDebugMode inside the nested Write-ScriptLog function scope. Re-adding targeted suppression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive quality improvements across the entire repository.
Code Quality
@() +=anti-pattern withList<PSObject>in 3 scriptsNew-Objectto[PSCustomObject]in Get-FolderPermissionsSupportsShouldProcessto Remove-OrphanedProfiles for destructive operationsFullAccess "Everyone"in New-ShareAndDFS (new-ShareAccessparam)#Requires -Modules ActiveDirectoryto Get-DeletedUsers and Get-UserLastLogonVersion: 1.0.0to.NOTESin all 8 scriptsDocumentation
.ps1extension for Send-PasswordExpiryNotification in root READMESystemMaintenance->Systemin CONTRIBUTING.mdsample-servers.csvin System/README.mdTesting
Tests/ScriptValidation.Tests.ps1with Pester test suite