WARNING: It is strongly advised not to compile scripts from unverified sources using this project due to the following reasons:
- ps12exe has the capability to indirectly include scripts from URLs. This implies that scripts from any URL can be incorporated into your script.
- ps12exe, through a set of not-so-stringent rules, determines if all or a part of a script could be a constant program, the content of which can be determined at compile time. If such a determination is made, ps12exe will automatically execute this script in an attempt to obtain the output.
This implies that if you compile a script whose content is unknown to you, there's a high possibility that ps12exe might download and execute a malicious script during the compile time.
If you're skeptical, try executing "while(1){}" | ps12exe -Verbose.
Install-Module ps12exe(you can also clone this repository and run ./ps12exe.ps1 directly)
ps12exeGUIps12exe .\source.ps1 .\target.execompiles source.ps1 into the executable target.exe (if .\target.exe is omitted, output is written to .\source.exe).
'"Hello World!"' | ps12execompiles "Hello World!" into the executable .\a.exe.
| Comparison Content | ps12exe | MScholtes/PS2EXE@678a892 |
|---|---|---|
| Pure script repository 📦 | ✔️ All text files except images | ❌ Contains exe files with open source license |
| Command to generate hello world 🌍 | 😎'"Hello World!"' | ps12exe |
🤔echo "Hello World!" *> a.ps1; ps2exe a.ps1; rm a.ps1 |
| Size of the generated hello world executable file 💾 | 🥰3584 bytes | 😨25088 bytes |
| GUI multilingual support 🌐 | ✔️ | ❌ |
| Syntax check during compilation ✔️ | ✔️ | ❌ |
| Preprocessing feature 🔄 | ✔️ | ❌ |
-extract and other special parameter parsing 🧹 |
🗑️ Removed | 🥲 Requires source code modification |
| PR welcome level 🤝 | 🥰 Welcome! | 🤷 14 PRs, 13 of which were closed |
Compared to MScholtes/PS2EXE@678a892, this project brings the following improvements:
| Improvement Content | Description |
|---|---|
| ✔️ Syntax check during compilation | Syntax check during compilation to improve code quality |
| 🔄 Powerful preprocessing feature | Preprocess the script before compilation, no need to copy and paste all content into the script |
🛠️ -CompilerOptions parameter |
New parameter, allowing you to further customize the generated executable file |
📦️ -Minifyer parameter |
Preprocess the script before compilation to generate a smaller executable file |
| 🌐 Support for compiling scripts and included files from URL | Support for downloading icons from URL |
🖥️ Optimization of -noConsole parameter |
Optimized option handling and window title display, you can now set the title of the custom pop-up window |
| 🧹 Removed exe files | Removed exe files from the code repository |
| 🌍 Multilingual support, pure script GUI | Better multilingual support, pure script GUI, support for dark mode |
| 📖 Separated cs files from ps1 files | Easier to read and maintain |
| 🚀 More improvements | And more... |
see English docs for more details.

