A comprehensive collection of PowerShell scripts for system administration, network management, security, development, and automation tasks.
This toolkit provides a set of powerful PowerShell scripts designed to help IT professionals, system administrators, developers, and power users automate common tasks and improve productivity. Each script is well-documented with detailed help information, examples, and parameter descriptions.
Scripts for managing and monitoring Windows systems.
- Get-SystemInfo.ps1: Retrieves comprehensive system information from local or remote computers, including hardware, operating system, installed software, and network configuration.
Scripts for network scanning, monitoring, and configuration.
- Scan-Network.ps1: Scans a network range for active hosts and open ports, providing detailed information about discovered devices.
Scripts for password management, security auditing, and hardening.
- Password-Manager.ps1: A secure password generator and manager that can create strong passwords and securely store them using Windows Data Protection API (DPAPI).
Scripts to assist with software development tasks.
- Generate-Code.ps1: Generates code templates and boilerplate for different programming languages and frameworks, saving time when starting new projects.
Scripts for task scheduling and process automation.
- Schedule-Tasks.ps1: Simplifies the creation and management of scheduled tasks on Windows systems, providing an easy-to-use interface for common scheduling operations.
Each script includes detailed help information that can be accessed using the PowerShell Get-Help cmdlet:
Get-Help .\Script-Name.ps1 -FullMost scripts also include examples in their header comments that demonstrate common usage scenarios.
- PowerShell 5.1 or later
- Windows 10/11 or Windows Server 2016/2019/2022
- Administrator privileges for some operations
This repository includes a comprehensive testing framework using Pester to ensure all scripts work correctly and maintain high code quality.
# Run all tests
.\RunTests.ps1
# Run with detailed output
.\RunTests.ps1 -ShowDetails
# Run in CI mode with coverage
.\RunTests.ps1 -TestType All -OutputFormat NUnitXml -CI
# Run only unit tests
.\RunTests.ps1 -TestType Unit
# Run only integration tests
.\RunTests.ps1 -TestType Integration- Unit Tests: Test individual script components in isolation
- Integration Tests: Test complete workflows and cross-script functionality
- Code Coverage: Maintains 80%+ test coverage across all scripts
- Security Analysis: Automated security scanning with PSScriptAnalyzer
- CI/CD Integration: Automated testing on every commit and pull request
- Performance Testing: Validates script execution time and resource usage
The testing framework generates comprehensive reports:
- Console Output: Real-time test results
- NUnit XML: For CI/CD integration
- Code Coverage Reports: JaCoCo format for coverage analysis
- Security Reports: Potential security issues and recommendations
For detailed testing information, see TESTING.md.
- Clone or download this repository to your local machine.
- Ensure PowerShell execution policy allows running the scripts:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- Navigate to the script directory and run the desired script with appropriate parameters.
- (Optional) Install Pester for running tests:
Install-Module -Name Pester -Force -SkipPublisherCheck -Scope CurrentUser
All scripts are validated through:
- Syntax Validation: PowerShell parser verification
- Unit Testing: Individual component testing
- Integration Testing: End-to-end workflow validation
- Security Scanning: PSScriptAnalyzer static analysis
- Performance Testing: Execution time and resource usage validation
This repository enforces quality standards through:
- Required Tests: All PRs must pass the complete test suite
- Code Coverage: Maintain 80%+ test coverage
- Security Review: Automated security analysis on all changes
- Peer Review: All changes require code review before merging
We welcome contributions to this PowerShell toolkit! To ensure high quality and maintainability, please follow these guidelines:
- Fork the repository and create a feature branch
- Run existing tests to ensure your environment is set up correctly:
.\RunTests.ps1 -ShowDetails - Make your changes following PowerShell best practices
- Write tests for new functionality (see TESTING.md)
- Run all tests to ensure nothing is broken:
.\RunTests.ps1 -CI - Submit a pull request with a clear description of your changes
- β Unit Tests: Test individual functions and components
- β Integration Tests: Test complete workflows (if applicable)
- β Documentation: Update help text and examples
- β Security Review: Ensure no security vulnerabilities
- β Performance Validation: Verify reasonable execution times
- β PowerShell Best Practices: Follow established conventions
- β Parameter Validation: Include proper input validation
- β Error Handling: Implement comprehensive error handling
- β Help Documentation: Include detailed help text with examples
- β Security Considerations: No hardcoded credentials or unsafe operations
- β 80%+ Code Coverage: Maintain or improve test coverage
- β All Tests Pass: Both unit and integration tests must pass
- β Mock External Dependencies: Mock CIM, network, file system operations
- β Performance Tests: Validate execution time requirements
-
Clone and Setup:
git clone https://github.com/404RX/PowerShell-Tools.git cd PowerShell-Tools .\RunTests.ps1 # Verify setup
-
Create Feature Branch:
git checkout -b feature/your-feature-name
-
Development Cycle:
# Make changes # Write tests .\RunTests.ps1 -TestType Unit # Quick validation .\RunTests.ps1 -CI # Full validation
-
Before Submitting:
# Final validation .\RunTests.ps1 -TestType All -ShowDetails # Check test coverage .\RunTests.ps1 -CI
- Never commit secrets: No passwords, API keys, or sensitive data
- Use secure practices: Leverage Windows DPAPI for credential storage
- Validate inputs: Sanitize all user inputs and parameters
- Review dependencies: Ensure all external calls are necessary and secure
- Document security considerations: Explain any security-related decisions
- Ensure all tests pass locally before submitting
- Update documentation for any new features or changes
- Include test results in your PR description
- Provide clear description of what your changes do and why
- Reference issues if your PR addresses existing issues
- Be responsive to code review feedback
Use clear, descriptive commit messages:
Add network latency monitoring to Scan-Network.ps1
- Include ping response time measurement
- Add timeout configuration parameter
- Update unit tests for new functionality
- Add integration test for latency monitoring
Tests: All unit and integration tests pass
Coverage: Maintains 85% code coverage
When reporting bugs:
- Use the issue template (if available)
- Include PowerShell version and operating system
- Provide script output and error messages
- Include test results if applicable
- Describe expected vs actual behavior
For new features:
- Describe the use case and business value
- Provide implementation suggestions if you have them
- Consider backward compatibility implications
- Discuss testing approach for the new feature
We're particularly interested in:
- Cross-platform support: Making scripts work on Linux/macOS
- Performance improvements: Optimizing script execution
- Additional test scenarios: Edge cases and error conditions
- Documentation improvements: Better examples and explanations
- Security enhancements: Additional security validations
- New script categories: Expanding the toolkit's capabilities
All pull requests undergo:
- Automated testing: GitHub Actions CI/CD pipeline
- Security analysis: PSScriptAnalyzer and manual review
- Code quality review: Maintainer review of code and tests
- Documentation review: Ensure adequate documentation
- Performance review: Validate execution time requirements
- Documentation: Start with TESTING.md for testing help
- Issues: Create a GitHub issue for bugs or questions
- Discussions: Use GitHub Discussions for general questions
- Code Review: Maintainers will provide feedback on PRs
Thank you for contributing to PowerShell-Tools! Your contributions help make this toolkit better for the entire PowerShell community.
This project is licensed under the MIT License - see the LICENSE file for details.
404RX
- Microsoft PowerShell Team for the amazing scripting language
- The PowerShell community for inspiration and best practices
- Scripts and documentation created with assistance from Claude AI (Anthropic)