Skip to content

nonomal/ps12exe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ps12exe

WARNING: It is strongly advised not to compile scripts from unverified sources using this project due to the following reasons:

  1. ps12exe has the capability to indirectly include scripts from URLs. This implies that scripts from any URL can be incorporated into your script.
  2. 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.

CI PSGallery download num GitHub issues by-label bug Codacy Badge CodeFactor PRs Welcome

repo img

中文 English

Install

Install-Module ps12exe

(you can also clone this repository and run ./ps12exe.ps1 directly)

Usage

GUI mode

ps12exeGUI

Console mode

ps12exe .\source.ps1 .\target.exe

compiles source.ps1 into the executable target.exe (if .\target.exe is omitted, output is written to .\source.exe).

'"Hello World!"' | ps12exe

compiles "Hello World!" into the executable .\a.exe.

Comparative Advantages 🏆

Quick Comparison 🏁

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

Detailed Comparison 🔍

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.

About

better repo 2 compile powershell scripts to exe

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PowerShell 50.9%
  • C# 49.1%