{"id":31626339,"url":"https://github.com/durgesh0505/psebuilder","last_synced_at":"2025-10-06T19:50:44.864Z","repository":{"id":317430099,"uuid":"1067216637","full_name":"durgesh0505/PSEBuilder","owner":"durgesh0505","description":"PowerShell Script to EXE Builder - Create standalone executables from PowerShell scripts with GUI, resource embedding, and code obfuscation","archived":false,"fork":false,"pushed_at":"2025-09-30T19:36:50.000Z","size":192,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T21:26:05.153Z","etag":null,"topics":["exe-builder","executable","obfuscation","powershell","powershell-script","powershell-scripts","ps2exe","ps2exe-gui","resource-embedding","script-compiler","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/durgesh0505.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-30T14:37:48.000Z","updated_at":"2025-09-30T20:55:53.000Z","dependencies_parsed_at":"2025-09-30T21:26:07.016Z","dependency_job_id":"87485ee4-5ea8-428b-9788-645c77649c43","html_url":"https://github.com/durgesh0505/PSEBuilder","commit_stats":null,"previous_names":["durgesh0505/psebuilder"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/durgesh0505/PSEBuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durgesh0505%2FPSEBuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durgesh0505%2FPSEBuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durgesh0505%2FPSEBuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durgesh0505%2FPSEBuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durgesh0505","download_url":"https://codeload.github.com/durgesh0505/PSEBuilder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durgesh0505%2FPSEBuilder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278671749,"owners_count":26025743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exe-builder","executable","obfuscation","powershell","powershell-script","powershell-scripts","ps2exe","ps2exe-gui","resource-embedding","script-compiler","windows"],"created_at":"2025-10-06T19:50:43.288Z","updated_at":"2025-10-06T19:50:44.851Z","avatar_url":"https://github.com/durgesh0505.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell Executable Builder (PSEBuilder)\n\n**A modern, GUI-based PowerShell executable builder** that creates standalone Windows executables from PowerShell scripts with embedded resources, custom icons, and professional metadata.\n\n[![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)](https://github.com/PowerShell/PowerShell)\n[![.NET Framework](https://img.shields.io/badge/.NET%20Framework-4.0+-green.svg)](https://dotnet.microsoft.com/)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n---\n\n## 🚀 Key Features\n\n- ✅ **Modern WPF GUI**: Easy-to-use graphical interface for building executables\n- ✅ **Zero Dependencies**: Works on any Windows machine with PowerShell 3.0+ and .NET Framework 4.0+\n- ✅ **Multi-Resource Embedding**: Scripts, images, configs, data files - all in one executable\n- ✅ **Automatic Image Conversion**: JPG/PNG → ICO conversion built-in\n- ✅ **Professional Metadata**: Company, version, copyright, description in exe properties\n- ✅ **Icon Support**: Embed custom icons for professional appearance\n- ✅ **Memory Safe**: No file locks, proper disposal, no memory leaks\n- ✅ **Security Hardened**: Input validation, resource size limits, injection-proof\n- ✅ **No Assembly Loading**: Direct csc.exe compilation prevents file locking issues\n\n---\n\n## 📸 Screenshot\n\n![PSEBuilder GUI](docs/screenshot.png)\n\n*Modern WPF interface with tabs for configuration and asset management*\n\n---\n\n## 🔧 Requirements\n\n**Built-in Windows Components (No Installation Needed):**\n- Windows 7+ with PowerShell 3.0+\n- .NET Framework 4.0+ (included with Windows)\n- **That's it!** No Visual Studio, no external packages, no complicated setup!\n\n---\n\n## 📖 Quick Start\n\n### Step 1: Launch the GUI\n```powershell\n.\\PSEBuilder.ps1\n```\n\n### Step 2: Configure Your Executable\n1. **Basic Configuration Tab**:\n   - Select your main PowerShell script (.ps1)\n   - Set executable name, version, description, company, copyright\n   - Choose icon file (optional - supports .ico, .jpg, .png, .bmp)\n   - Configure execution options (admin rights, window visibility, timeout)\n   - Select output location for your .exe file\n\n2. **Assets Tab**:\n   - Add any additional files: images, configs, certificates, data files\n   - All files will be embedded and accessible at runtime\n\n### Step 3: Build\n- Click **\"Build Executable\"** button\n- Wait for compilation to complete\n- Your executable is ready!\n\n### Step 4: Use Your Executable\n```cmd\nMyTool.exe\n```\n\nThat's it! Everything is embedded in a single .exe file.\n\n---\n\n## 🎯 How It Works\n\n### Build Process\n1. **Resource Embedding**: Files are Base64-encoded and embedded into C# code\n2. **Direct Compilation**: Uses `csc.exe` directly (no Add-Type assembly loading)\n3. **Runtime Extraction**: C# wrapper extracts resources to temp directory\n4. **PowerShell Execution**: Launches `powershell.exe` with your script\n5. **Automatic Cleanup**: Temp files cleaned up after execution\n\n### Resource Access in Your Scripts\nPSEBuilder automatically provides the `Get-ResourcePath` helper function:\n\n```powershell\n# In your PowerShell script:\n$imagePath = Get-ResourcePath \"logo.png\"\n$configPath = Get-ResourcePath \"config.json\"\n\n# Use the files normally\n$config = Get-Content $configPath | ConvertFrom-Json\n$image = [System.Drawing.Image]::FromFile($imagePath)\n```\n\nSee [RESOURCE-ACCESS-GUIDE.md](docs/RESOURCE-ACCESS-GUIDE.md) for details.\n\n---\n\n## 💡 Example: Building a GUI App with Resources\n\n**1. Create your PowerShell GUI script** (`my-app.ps1`):\n```powershell\nAdd-Type -AssemblyName PresentationFramework\n\n# Access embedded resources\n$logoPath = Get-ResourcePath \"logo.png\"\n$configPath = Get-ResourcePath \"config.json\"\n\n# Build your WPF GUI...\n$window = New-Object System.Windows.Window\n$window.Title = \"My App\"\n# ... rest of your GUI code\n$window.ShowDialog()\n```\n\n**2. Launch PSEBuilder**:\n```powershell\n.\\PSEBuilder.ps1\n```\n\n**3. In the GUI**:\n- Browse to `my-app.ps1`\n- Set Name: \"My Application\"\n- Set Version: \"1.0.0\"\n- Add icon: `logo.ico` (or `logo.png` - auto-converted!)\n- Go to Assets tab → Add Files: `logo.png`, `config.json`\n- Set output path: `MyApp.exe`\n- Click **Build Executable**\n\n**4. Distribute**:\n- Single file: `MyApp.exe`\n- No dependencies, no installation\n- All resources embedded\n\nSee [examples/test-gui-app.ps1](examples/test-gui-app.ps1) for a complete working example.\n\n---\n\n## ⚙️ Configuration Options\n\n### Basic Configuration Tab\n\n| Setting | Description | Example |\n|---------|-------------|---------|\n| **Main Script** | Primary PowerShell script to execute | `scripts/main.ps1` |\n| **Name** | Application name | \"My PowerShell Tool\" |\n| **Version** | Semantic version | \"1.0.0\" |\n| **Description** | App description | \"Custom PowerShell executable\" |\n| **Company** | Company name | \"Your Company\" |\n| **Copyright** | Copyright year | \"2025\" |\n| **Icon File** | Icon for exe (auto-converts images) | `icon.ico` or `icon.jpg` |\n\n### Execution Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| **Require Administrator** | Force UAC elevation | Unchecked |\n| **Show PowerShell Window** | Visible console | Unchecked |\n| **Timeout** | Max execution time (minutes) | 5 |\n| **Execution Policy** | PowerShell execution policy | Bypass |\n| **Working Directory** | Script working directory | %TEMP% |\n\n### Assets Tab\n\nAdd any files to embed:\n- **Images**: PNG, JPG, GIF, BMP\n- **Configs**: JSON, XML, INI, CFG\n- **Certificates**: PFX, CER, CRT\n- **Data**: TXT, CSV, any file type\n- **Size Limit**: 100MB per file\n\n---\n\n## 🔒 Security Features\n\n### Input Validation\n- ✅ Resource size limits (100MB per file)\n- ✅ Filename validation (no path traversal)\n- ✅ Timeout range validation (1-1440 minutes)\n- ✅ Version format validation\n\n### Compilation Security\n- ✅ Injection-proof string escaping (handles all special characters)\n- ✅ Resource key validation (alphanumeric + safe chars only)\n- ✅ No code execution during build\n- ✅ Separate process compilation (csc.exe)\n\n### Runtime Security\n- ✅ Temp directory isolation\n- ✅ Automatic cleanup on exit\n- ✅ Optional admin elevation\n- ✅ Execution policy enforcement\n\n---\n\n## 🚫 Limitations \u0026 Considerations\n\n### Current Limitations\n- **Windows-only**: Requires Windows PowerShell and .NET Framework\n- **PowerShell 5.1**: Not compatible with PowerShell 7+ (Core) scripts\n- **File Icon Only**: Taskbar shows PowerShell icon (limitation of C# → PowerShell.exe architecture)\n- **Temp File Storage**: Resources extracted to temp directory at runtime\n- **No Digital Signing**: You must sign the exe separately if needed\n\n### Best Practices\n- Test your script standalone before building\n- Keep resource files under 50MB for best performance\n- Use relative paths in your scripts\n- Don't hardcode absolute paths\n- Test built exe on clean systems\n\n---\n\n## 🆚 Comparison with Similar Tools\n\n| Feature | PSEBuilder | PS2EXE | PowerChell | Other GUI Tools |\n|---------|-----------|---------|------------|-----------------|\n| **GUI Interface** | ✅ Modern WPF | ❌ CLI Only | ❌ CLI Only | ⚠️ Various |\n| **Multi-File Resources** | ✅ Yes | ❌ Single Script | ⚠️ Limited | ⚠️ Varies |\n| **Image → Icon Conversion** | ✅ Automatic | ❌ No | ❌ No | ⚠️ Rarely |\n| **Assembly Metadata** | ✅ Full Support | ⚠️ Basic | ⚠️ Basic | ⚠️ Varies |\n| **No File Locking** | ✅ csc.exe Direct | ❌ Locks | ❌ Locks | ⚠️ Varies |\n| **Memory Safe** | ✅ Try-Finally | ⚠️ Basic | ⚠️ Basic | ⚠️ Unknown |\n| **Dependencies** | ✅ None | ✅ None | ✅ None | ⚠️ May Require |\n| **Security Hardened** | ✅ Yes | ⚠️ Basic | ⚠️ Basic | ⚠️ Unknown |\n\n---\n\n## 📁 Project Structure\n\n```\nPowershell_CPP/\n├── PSEBuilder.ps1              # Main GUI application\n├── examples/\n│   ├── test-gui-app.ps1       # Example WPF GUI app with resources\n│   ├── test.txt               # Example text file\n│   └── image.png              # Example image file\n├── docs/\n│   ├── RESOURCE-ACCESS-GUIDE.md   # How to access embedded resources\n│   ├── USAGE-GUIDE.md            # Detailed usage guide\n│   └── COMPREHENSIVE-DOCUMENTATION.md  # Complete reference\n└── README.md                  # This file\n```\n\n---\n\n## 🐛 Troubleshooting\n\n### Build Issues\n\n**\"C# compiler (csc.exe) not found\"**\n- Install .NET Framework 4.0 or higher\n- csc.exe should be in: `C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\`\n\n**\"Compilation failed with exit code 1\"**\n- Check debug log in `Downloads\\PSEBuilder-Debug-*.log`\n- Ensure your PowerShell script has no syntax errors\n- Try running script standalone first\n\n**\"File is locked\" error**\n- Old issue - FIXED in latest version!\n- Using csc.exe directly prevents file locking\n\n### Runtime Issues\n\n**\"Resources not found in exe\"**\n- Resources are extracted to `$env:PS_RESOURCE_DIR`\n- Use `Get-ResourcePath` helper function\n- Check `Downloads\\TestGUI-Runtime-*.log` for debugging\n\n**\"PowerShell icon shows in taskbar\"**\n- This is a known limitation of the architecture\n- File icon works correctly\n- Taskbar icon shows PowerShell.exe (the actual running process)\n- Workaround: Create a Windows shortcut (.lnk) with custom icon\n\n---\n\n## 🙏 Credits \u0026 Inspiration\n\nThis project was inspired by and builds upon ideas from:\n\n### Main Inspiration\n- **[PS2EXE](https://github.com/MScholtes/PS2EXE)** by MScholtes\n  - The original and most popular PowerShell → EXE converter\n  - Pioneered the concept of embedding PowerShell scripts in C# wrappers\n  - PSEBuilder adds GUI, multi-resource support, and advanced features\n\n### Additional References\n- **[PowerChell](https://github.com/scrt/PowerChell)** by scrt\n  - Alternative PowerShell executable approach\n  - Demonstrated shellcode execution techniques\n\n- **[Reinventing PowerShell](https://itm4n.github.io/reinventing-powershell/)** by itm4n\n  - Excellent deep-dive article on PowerShell executable internals\n  - Inspired security hardening and architecture decisions\n\n- **[PrivescCheck](https://github.com/itm4n/PrivescCheck)** by itm4n\n  - Example of professional PowerShell tool distribution\n  - Demonstrated best practices for PowerShell security\n\n### Key Innovations in PSEBuilder\n- Modern WPF GUI (no command-line needed)\n- Multi-file resource embedding system\n- Automatic image-to-icon conversion\n- Direct csc.exe compilation (no file locking)\n- Memory-safe try-finally disposal patterns\n- Comprehensive security validation\n- Professional assembly metadata\n\n**Thank you to all the PowerShell community members who continue to push the boundaries of what's possible!**\n\n---\n\n## 🤝 Contributing\n\nContributions welcome! Areas for improvement:\n\n- [ ] PowerShell 7+ (Core) support\n- [ ] Linux/.NET Core compatibility\n- [ ] Digital signature validation\n- [ ] AES encryption for sensitive resources\n- [ ] Plugin system for custom resource handlers\n- [ ] Build automation (CI/CD integration)\n- [ ] Localization support\n- [ ] Dark mode UI theme\n\n**How to Contribute:**\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n---\n\n## 📄 License\n\nMIT License - See [LICENSE](LICENSE) file for details.\n\n**Use this tool responsibly:**\n- ✅ Package your own PowerShell scripts\n- ✅ Distribute tools within your organization\n- ✅ Create professional applications\n- ❌ Don't create malware or malicious tools\n- ❌ Don't bypass security controls\n- ❌ Don't violate software licenses\n\n---\n\n## 📚 Documentation\n\n- [RESOURCE-ACCESS-GUIDE.md](docs/RESOURCE-ACCESS-GUIDE.md) - How to access embedded resources in your scripts\n- [USAGE-GUIDE.md](docs/USAGE-GUIDE.md) - Detailed usage instructions\n- [COMPREHENSIVE-DOCUMENTATION.md](docs/COMPREHENSIVE-DOCUMENTATION.md) - Complete technical reference\n\n---\n\n## 💬 Support\n\n- **Issues**: [GitHub Issues](https://github.com/durgesh0505/PSEBuilder/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/durgesh0505/PSEBuilder/discussions)\n- **Documentation**: Check the `/docs` folder\n\n---\n\n## 🔮 Roadmap\n\n### Version 1.1 (Next Release)\n- [ ] Configuration save/load (JSON presets)\n- [ ] Recent files menu\n- [ ] Build history\n- [ ] Drag-and-drop file support\n\n### Version 2.0 (Future)\n- [ ] PowerShell 7+ support\n- [ ] Linux/.NET Core support\n- [ ] Command-line mode (scriptable builds)\n- [ ] Template system\n- [ ] Plugin architecture\n\n---\n\n**PowerShell Executable Builder** - Making PowerShell distribution simple and professional!\n\n*Built with ❤️ for the PowerShell community*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurgesh0505%2Fpsebuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurgesh0505%2Fpsebuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurgesh0505%2Fpsebuilder/lists"}