Skip to content

A powerful PowerShell script for sending batch HTTP requests with parallel processing and real-time monitoring.

License

Notifications You must be signed in to change notification settings

Ash1421/Batch-Invoke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ PowerShell Batch Request Invoker

A powerful PowerShell script for sending batch HTTP requests with parallel processing and real-time monitoring

✨ Socials & Stars

Discord GitHub Stars

πŸ“Š Github Repository Information

Version GitHub Issues Closed Issues New Issue

πŸ’œ Made With Love Using

PowerShell Windows Terminal Markdown Open Source

πŸ“œ Licensed Under

License: GPL v3


πŸ“‹ Table of Contents


✨ Features

  • Parallel Processing: Send multiple HTTP requests simultaneously with configurable concurrency
  • Real-time Progress Bar: Beautiful gradient progress indicator with live statistics
  • Multiple URL Support: Process requests to multiple URLs from a file or single URL input
  • Performance Metrics: Track request rate, success/failure counts, and execution time
  • Error Handling: Robust error handling with failure tracking and reporting
  • Configurable: Easy-to-modify configuration variables at the top of the script
  • Visual Feedback: Color-coded output with ASCII art header and detailed summaries

πŸ’» Requirements

  • Operating System: Windows 10/11, Windows Server 2016+
  • PowerShell: Version 5.1 or higher
  • Permissions: Ability to execute PowerShell scripts (see Installation)
  • Network: Active internet connection for sending HTTP requests

πŸ“¦ Installation

1. Download the Script

Clone this repository or download the script directly:

git clone https://github.com/Ash1421/batch-invoke.git
cd batch-invoke

2. Set Execution Policy (Optional)

PowerShell may block script execution by default. You have two options:

Option A: Bypass for Single Execution (Recommended)

powershell -ExecutionPolicy Bypass -File ".\batch-request-invoker.ps1"

Option B: Change Policy Permanently

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

3. Verify Installation

Check your PowerShell version:

$PSVersionTable.PSVersion

Ensure it's 5.1 or higher.


πŸš€ Usage

Basic Usage

  1. Open PowerShell
  2. Navigate to the script directory
  3. Run the script:

Method 1: Bypass execution policy (no admin required)

powershell -ExecutionPolicy Bypass -File ".\batch-request-invoker.ps1"

Method 2: Direct execution (if policy already set)

.\batch-request-invoker.ps1
  1. Follow the interactive prompts:
    • Enter the total number of requests
    • Specify max parallel requests
    • Provide a URL or press Enter for default

Interactive Prompts

β†’ Total number of requests: 100
β†’ Max parallel requests: 10
β†’ URL (Enter for default): https://example.com

βš™οΈ Configuration

Edit the configuration variables at the top of the script:

Configuration Variables

$ENABLE_URL_FILE = $false  # Enable/disable URL file feature
$DEFAULT_URL = "example.com"  # Default URL when none provided

URL File Feature

When $ENABLE_URL_FILE = $true, you can create a urlfile.txt in the same directory as the script:

urlfile.txt example:

https://api1.example.com/endpoint
https://api2.example.com/endpoint
https://example.com/test
https://another-site.com

The script will cycle through these URLs for your requests.


πŸ“– Examples

Example 1: Simple Load Test

# Run the script
.\batch-request-invoker.ps1

# Input:
Total number of requests: 50
Max parallel requests: 5
URL: https://httpbin.org/get

Example 2: High-Volume Parallel Requests

# Configuration for stress testing
Total number of requests: 1000
Max parallel requests: 50
URL: https://your-api.com/health

Example 3: Multiple URLs

  1. Set $ENABLE_URL_FILE = $true
  2. Create urlfile.txt with your URLs
  3. Run the script and choose 'y' when asked about urlfile.txt

πŸ”§ Advanced Features

Progress Bar

The script displays a real-time progress bar with:

  • Visual Progress: Gradient bar showing completion percentage
  • Success Count: Number of completed requests
  • Active Jobs: Current parallel requests in progress
  • Failed Requests: Number of failed requests
  • Request Rate: Current requests per second

Color Coding

  • 🟣 Purple/Magenta: Headers and branding
  • 🟒 Green: Successful operations
  • πŸ”΄ Red: Failed requests
  • 🟑 Yellow: Active/in-progress operations
  • πŸ”΅ Blue: Informational messages
  • βšͺ White: Primary data

Performance Metrics

After completion, you'll see:

  • Total requests sent
  • Successful vs failed requests
  • Total execution time
  • Average request rate (req/s)

πŸ› Troubleshooting

Script Won't Execute

Error: "cannot be loaded because running scripts is disabled"

Solution A (No admin required):

powershell -ExecutionPolicy Bypass -File ".\batch-request-invoker.ps1"

Solution B (Permanent fix):

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

High Failure Rate

  • Check your network connection
  • Verify the target URL is accessible
  • Reduce maxParallel value to avoid overwhelming the server
  • Check if the target has rate limiting

Slow Performance

  • Increase maxParallel for faster execution (within reason)
  • Ensure your network bandwidth can handle the load
  • Check target server response times

URL File Not Found

  • Ensure urlfile.txt is in the same directory as the script
  • Check file name spelling and extension
  • Verify the file contains valid URLs (one per line)

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Ideas for Contributions

  • Add support for custom HTTP headers
  • Implement POST/PUT/DELETE request methods
  • Add response time tracking
  • Create CSV export for results
  • Add authentication support (Bearer tokens, Basic Auth)
  • Implement retry logic for failed requests

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

GPL v3 Summary

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Patent use
  • βœ… Private use
  • ⚠️ Must disclose source
  • ⚠️ Must use same license
  • ⚠️ Must state changes
  • ❌ Liability
  • ❌ Warranty

Key Point: Any modifications or derivative works must also be licensed under GPL v3 and made open source.


πŸ‘¨β€πŸ’» Author

@Ash1421


πŸ™ Acknowledgments

  • Built with PowerShell's powerful job management system
  • Inspired by the need for simple load testing tools
  • Thanks to the PowerShell community for best practices

πŸ“Š Use Cases

  • Load Testing: Test your application's performance under load
  • API Testing: Validate API endpoints with multiple requests
  • Health Checks: Verify service availability across multiple endpoints
  • Stress Testing: Determine system breaking points
  • Warm-up: Prime caches and connections before production load

⚠️ Disclaimer

This tool is designed for testing your own services or services you have permission to test. Unauthorized load testing or stress testing of third-party services may be illegal and is strictly prohibited. Always obtain proper authorization before testing any system.


If you find this tool useful, please consider giving it a ⭐!

Made with πŸ’œ by @Ash1421

About

A powerful PowerShell script for sending batch HTTP requests with parallel processing and real-time monitoring.

Topics

Resources

License

Stars

Watchers

Forks