Skip to content

better powershell code 2 exe repo wis: multilang sport, darkmode-able GUI(+BGM), RClick menu ext, webserver 4 online comp. All in only 1mb, superez4use, pure script (excl. deps/imgs/oggs). Compatible with PS2EXE useage.

License

Notifications You must be signed in to change notification settings

steve02081504/ps12exe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ps12exe

Caution

Do not store passwords in source code!
See localed readme for more details.

Introduction

ps12exe is a PowerShell module that allows you to create an executable file from a .ps1 script.

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

repo img

中文 English 日本語 Español हिन्दी

Install

Install-Module ps12exe #Install ps12exe module
Set-ps12exeContextMenu #Set right-click menu

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

Hard to upgrade from PS2EXE to ps12exe? No problem!
PS2EXE2ps12exe can hooks PS2EXE calls into ps12exe, All you need is just uninstall PS2EXE and install this, then use PS2EXE as normal.

Uninstall-Module PS2EXE
Install-Module PS2EXE2ps12exe

Usage

Right-click menu

Once you have set Set-ps12exeContextMenu, you can quickly compile any ps1 file into an exe or open ps12exeGUI on this file by right-clicking on it.
image

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.

ps12exe https://raw.githubusercontent.com/steve02081504/ps12exe/master/src/GUI/Main.ps1

compiles Main.ps1 from the internet into the executable .\Main.exe.

Self-Host WebServer

Start-ps12exeWebServer

Starts a web server that can be used to compile powerShell scripts online.

Comparative Advantages 🏆

Quick Comparison 🏁

Comparison Content ps12exe MScholtes/PS2EXE@678a892
Pure script repository 📦 ✔️ All text files except images & dependencies ❌ 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 💾 🥰1024 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 localed readme for more details.