Skip to content

Conversation

@Mark5900
Copy link
Owner

@Mark5900 Mark5900 commented Jan 8, 2026

No description provided.

Mark5900 added 30 commits April 24, 2025 09:36
Changed test parameters in Add-CCSADComputerToSecurityGroup.Tests.ps1 to use updated URLs and computer names. Set a default value of an empty string for the DomainOUPath parameter in Add-CCSADComputerToSecurityGroup.ps1.
Updated all relevant PowerShell scripts to replace direct calls to Job_WriteLog with $Global:Cs.Job_WriteLog for consistency and to ensure logging is routed through the global context. This change improves maintainability and aligns logging practices across the module.
Expanded Add-CCSADComputerToSecurityGroup to include advanced parameter validation, pipeline support, improved error handling, and detailed documentation. Added a full Pester test suite covering parameter validation, aliases, input formats, integration, error handling, and performance. Updated GitHub Actions workflow to support new environment variables and increased Pester output verbosity.
Updated the BeforeAll block to dynamically load all PowerShell scripts in the Dev directory except test scripts. This ensures all dependencies are loaded for the tests.
Introduces Invoke-CCSErrorHandling function for consistent, structured error reporting and logging in CCS module. Refactors Add-CCSADComputerToSecurityGroup to use the new error handler, improving error categorization, recommended actions, and integration with global logging. Adds comprehensive Pester tests for Invoke-CCSErrorHandling to ensure robust error handling and logging behavior.
…ityGroup

Enhanced error handling in Add-CCSADComputerToSecurityGroup by making ErrorAction 'Stop' behavior explicit and adding debug output. Updated tests to require HTTPS URLs, improved credential handling, and added more integration and error scenarios. Expanded Invoke-CCSIsError to recognize additional error messages from CCS Web Service.
Implemented full Pester test coverage for Add-CCSADUserToSecurityGroup, including parameter validation, alias checks, input validation, integration, error handling, and performance tests. Refactored the function to support advanced parameter validation, improved error handling, pipeline input, WhatIf/Confirm support, and detailed logging. Enhanced documentation and added support for multiple user input and flexible OU path formats.
Introduced a Finally block to ensure the temporary folder is removed after execution, improving resource management and preventing leftover temp files.
Updated the log deletion logic to allow removal of all logs when $DeleteAllLogs is set to true, in addition to deleting logs older than the specified number of days.
Implemented a full Pester test suite for Add-CCSADDomainLocalSecurityGroup, covering parameter validation, aliases, input formats, error handling, integration, and performance. Refactored the function to include advanced parameter validation, improved error handling, pipeline support, detailed documentation, and verbose logging. The function now robustly handles multiple group names, supports ShouldProcess, and provides clearer error messages and output.
Implemented comprehensive Pester tests for Add-CCSADGlobalSecurityGroup, covering parameter validation, aliases, input formats, error handling, and integration scenarios. Refactored the function to include advanced parameter validation, improved error handling, pipeline support, WhatIf/Confirm support, and detailed logging, making the cmdlet more robust and testable.
Implemented comprehensive Pester tests for Add-CCSADUniversalSecurityGroup, covering parameter validation, integration, error handling, and performance. Refactored the function to include advanced parameter validation, improved error handling, pipeline support, and detailed logging. The function now provides better feedback, supports multiple group creation, and aligns with PowerShell best practices.
Corrected 'ogen' to 'open' in the instructions for accessing the CCSWebservice path.
Introduces comprehensive Pester tests for Get-CCSADComputerNames, covering parameter validation, error handling, and integration scenarios. Refactors the function to include advanced parameter validation, improved error handling, verbose/debug logging, and support for ShouldProcess. The function now enforces stricter input validation, provides clearer error messages, and better supports pipeline and WhatIf/Confirm scenarios.
Rewrote Get-CCSEncryptedPassword as an advanced function with SecureString input, pipeline support, robust error handling, and improved parameter validation. Expanded and modernized the Pester test suite to cover parameter validation, pipeline support, encryption logic, error handling, and output type.
Rewrote Initialize-CCS as an advanced function with improved parameter validation, error handling, and verbose/debug output. Added comprehensive Pester tests covering parameter validation, input validation, URL validation, integration, error handling, and performance. Enhanced documentation and support for parameter aliases.
Refactored Remove-CCSADComputer to support pipeline input, multiple computer names, and improved parameter validation for Domain, Url, and DomainOUPath. Added parameter aliases, comprehensive error handling, and detailed comment-based help. Updated tests to cover new validation logic, pipeline scenarios, and performance, ensuring robust function behavior and improved usability.
Introduces the Create-CCSADSecurityGroupsForShares advanced PowerShell function for creating AD security groups for network shares via the CCS Web Service, with comprehensive parameter validation, error handling, and support for custom group formats. Includes a full Pester test suite covering parameter validation, integration, and performance scenarios.
Updated the UnitTests GitHub Actions workflow to exclude tests tagged with 'Integration' and 'Performance'. Marked the Get-CCSEncryptedPassword test suite with the 'Integration' tag to align with the new filter.
Introduces the Get-CCSADComputerOU advanced PowerShell function for retrieving the OU path of computers in Active Directory via the CCS Web Service, with comprehensive parameter validation, error handling, and pipeline support. Includes a full Pester test suite covering parameter validation, integration, error handling, and performance scenarios.
Introduces the Get-CCSADCustomAttributeForUser advanced function for retrieving custom Active Directory attributes via the CCS Web Service, with support for pipeline input, parameter validation, and error handling. Includes a comprehensive Pester test suite covering parameter validation, integration, error handling, and performance scenarios.
Introduces the Get-CCSADDescriptionForGroup advanced PowerShell function for retrieving Active Directory group descriptions via the CCS Web Service, with robust parameter validation, error handling, and pipeline support. Includes a comprehensive Pester test suite covering parameter validation, integration, error handling, and performance scenarios.
Introduces the Get-CCSADDisplayNameForUser advanced PowerShell function for retrieving user display names from Active Directory via the CCS Web Service, with comprehensive parameter validation, error handling, and pipeline support. Includes a full Pester test suite covering parameter validation, integration, error handling, and performance scenarios.
Introduces the Get-CCSADEmailForUser advanced PowerShell function for retrieving user email addresses from Active Directory via the CCS Web Service, with comprehensive parameter validation, error handling, and pipeline support. Includes a full Pester test suite covering parameter validation, integration, error handling, and performance scenarios.
Introduces the Get-CCSADLastLoginForComputers advanced function for retrieving last login information for computers in Active Directory via the CCS Web Service. Includes comprehensive parameter validation, error handling, and output formatting. Adds a corresponding Pester test suite covering parameter validation, integration, error handling, and performance.
Introduces the Get-CCSADOUStructure advanced PowerShell function for retrieving hierarchical OU structures from Active Directory via the CCS Web Service, with robust parameter validation, error handling, and output formatting. Includes a comprehensive Pester test suite covering unit, integration, and performance scenarios for the new cmdlet.
Introduces the Get-CCSADSid advanced PowerShell function for retrieving computer SIDs from Active Directory via the CCS Web Service, with robust parameter validation, error handling, and pipeline support. Includes a comprehensive Pester test suite covering unit, integration, and performance scenarios for the new cmdlet.
Introduces the Confirm-CCSADUser PowerShell function for validating user credentials against Active Directory via the CCS Web Service, supporting both PrincipalContext and LDAP validation. Includes comprehensive Pester tests for parameter validation, function attributes, and switch parameters.
Introduces the Move-CCSADComputer advanced function for moving computers between OUs in Active Directory via the CCS Web Service, with robust parameter validation, error handling, and pipeline support. Includes a comprehensive Pester test suite covering parameter validation, input formats, integration, error handling, and performance.
Introduces the Remove-CCSADComputerFromSecurityGroup advanced function for removing computers from AD security groups via the CCS Web Service, with robust parameter validation, error handling, and pipeline support. Includes a comprehensive Pester test suite covering parameter validation, integration, error handling, and performance.
Introduces the Remove-CCSADUserFromSecurityGroup advanced function for removing users from Active Directory security groups via the CCS Web Service, with comprehensive parameter validation, error handling, and pipeline support. Includes a full Pester test suite covering parameter validation, input formats, integration, and performance scenarios.
Introduces the Test-CCSADIsUserMemberOfGroup advanced function for checking Active Directory group membership via the CCS Web Service, with comprehensive parameter validation, error handling, and support for various credential and OU path formats. Includes a full Pester test suite covering parameter validation, integration, error handling, and performance scenarios.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive CCS (Capa Control System) Web Service integration to the PowerShell module. The changes introduce new functions for Active Directory operations through the CCS Web Service, including user/computer management, security group operations, and improved test infrastructure.

Key Changes:

  • Addition of 11 new CCS module functions with full test coverage for AD operations
  • Enhanced error handling with new Invoke-CCSErrorHandling helper function
  • Improvements to existing test files with better module import patterns
  • Updates to Initialize-CCS and Get-CCSEncryptedPassword with advanced function patterns
  • Test infrastructure improvements including multi-environment support (Dev/Prod)

Reviewed changes

Copilot reviewed 70 out of 70 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Test-CCSADIsUserMemberOfGroup.ps1 New function to test user membership in AD security groups
Remove-CCSADUserFromSecurityGroup.ps1 New function to remove users from AD security groups
Remove-CCSADComputerFromSecurityGroup.ps1 New function to remove computers from AD security groups
Remove-CCSADComputer.ps1 Enhanced function to remove computers from AD with improved error handling
Move-CCSADComputer.ps1 New function to move computers between OUs
Get-CCSADSid.ps1 New function to retrieve computer SIDs
Get-CCSADOUStructure.ps1 New function to retrieve AD OU hierarchy
Invoke-CCSIsError.ps1 Enhanced error detection logic
Invoke-CCSErrorHandling.ps1 New centralized error handling helper
Initialize-CCS.ps1 Enhanced with advanced function patterns and validation
Get-CCSEncryptedPassword.ps1 Enhanced with SecureString support and validation
Various test files Improved test infrastructure with dynamic module loading
New-CapaPowerPack.ps1 Added cleanup in finally block
Start-ScriptLogging.ps1 Added DeleteAllLogs functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mark5900 Mark5900 merged commit e71320c into Prerelease Jan 8, 2026
6 of 7 checks passed
@Mark5900 Mark5900 deleted the Add-CCS branch January 8, 2026 08:17
@ignore-branch-protection
Copy link

🎉 This PR is included in version 1.16.0-Prerelease.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants