PS1 To Exe Generator - New version

In this post, I will show you the new version of my tool PS1 To EXE generator that allows you to generate an EXE file from a PowerShell project, choose the main ps1 and inlude other files and folders.

In this new version, there is some new features:
- New design
- Possibility to require or not admin rights for your EXE
- Possibility to set a password 
- Possibility to add paramaters to your PS1 script
- Check WinRAR informations

The EXE file is an SFX archive build with WinRAR meaning Winrar is required.
Even if WinRar prompts you for a licence, it's not mandatory, you can still use it :-)

Known issue
Your EXE may be connsidered as a Trojan by your antivirus.
In fact it's false positive report.
See below some articles about this subject:

Other ways
There are plenty ways to build an EXE but for most of them you have to pay.
There is also another very cool solution called PS2EXE. However with this solution you can only create an EXE from one PS1 file, meaning you can not build a project with a PS1 that will run other files.
In my case I build WPF tools that need some assemblies, meaning PS2EXE can not help me.

How to get the tool ?

How it looks like ?
The tool is now composed of two parts.
The first part allows you to select your EXE options, name, icon, path...
The second part will check if Winrar is installed or not.

How to use it ?
1 / Run the PS1 To EXE Generator.exe or run the PS1 located in the Sources folder as below:
2 / Select your PowerShell project. This project should be the folder containing your PS1 file.
3 / Type the name of the EXE.
4 / Choose the main PS1 file that will be run after running the EXE file. 
5 / Choose an icon if needed
6 / Click on the Build the EXE button to create your EXE.
7 / Once it's done the below message appears and your EXE file will be created in your Desktop.

More options

Admin rights
In the EXE configuration part, the Requires admin rights CheckBox allows you to ask or not admin rights after running the EXE. 

Set a Password 
This function allows you to ask for a password after running the EXE.
Click on the button in the title bar and check the set a password checkbox, as below:

Now when you run your EXE, you will have to type your password as below:

If a bad password is typed, you will get the below message

Add parameters
Click on the More options button in the title bar, as above.
In the Add parameters to your PS1 TextBox, type the parameters to add. Don't forget to type with "-"

Tool in action
- I want to build an EXE to run a PowerShell tool.
- The PS1 that will launch the tool is called BIOS_Checker.ps1
- The folder containing the PS1 is like below:
See below the tool in action

See below the EXE in action

Share this

Related Posts

Next Post »