Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Module to compile PowerShell code to executeables - Improved PS2EXE

License

5Noxi/ps12exe

 
 

Repository files navigation

PS12exe

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

preview

Installation

You can clone this repository and run ./ps12exe.ps1 directly, or use:

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

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.
contextm

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.

Caution

Do not store passwords in source code (*)

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 (GUI) 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...

Note

More details: localed readme.

About

Module to compile PowerShell code to executeables - Improved PS2EXE

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 72.7%
  • C# 24.1%
  • JavaScript 1.7%
  • Other 1.5%