Convert PowerShell script to exe

80,674

Solution 1

Use PS2EXE instead of this online tool that forces you to upload your script and creates a security breach if you have confidential information inside your script.

There is a GUI mode available; to learn more, see the GitHub repository.

Solution 2

You have a few paid and unpaid solutions. I agree with last answer, do not use online tools unless you are sure they are not keeping your code and you trust them.

There are two free ones that come to mind:

PS2EXE-GUI

PS1 To EXE by F2KO (Make sure t it is the local install command line interface, not the web one)

The Paid ones are:

PowerShell Studio

ISE Steroids 2.0 Enterprise

Noted: I think the free ones should be fine for most uses. I do like PowerShell Studio though.

Solution 3

An update to PS2EXE tool (all versions are open-source):

The original script comes from Ingo Karstein, but the development seems to have halted in 2017. You can find his blog here, and his contribution on Microsoft Technet's forums here.

Markus Scholtes has continued the script's development, adding some useful features. You can find his post on Microsoft Technet here, and github repository here.

Powershelling's answer point you to a fork of Markus' project by Stuart Dootson (here and here), which is less maintained. The obvious difference would be the "Added support for scripts that require elevation. This inserts a suitable manifest into the executable produced by the tool. that .exe files built with his version of the script require elevation".

I'd recommend checking out Markus Scholtes' version, but beware (!) (README.md on 3rd Nov 2020):

Attention: Incorrect virus detection of PS2EXE

Some stupid idiot seems to have abused PS2EXE to compile his computer virus script. As a result, a rapidly growing number of virus scanners recognize programs created with PS2EXE as malicious programs and delete them.

There is only one hope to save the PS2EXE project: Please send your (harmless) programs created with PS2EXE via the web forms from the virus scanners' vendors for reporting false positives (I've already done it with some of them, please use only the false positive page)!

If this is not successful, then I will have to quit PS2EXE as nobody can use it anymore.

Thank you for your support

Share:
80,674

Related videos on Youtube

Matthew
Author by

Matthew

Currently working as a system engineer and taking photos in my part-time.

Updated on May 01, 2021

Comments

  • Matthew
    Matthew about 3 years

    I'm looking to convert a PS1 file to an .exe file so I can roll it out to less technical users.

    I believe it'll be much easier for them if all they need to do is double-click it vs explaining how to run through PowerShell.

    How can I achieve this?

    image

  • miguello
    miguello over 3 years
    PS2EXE would require imported modules to be also accessible on the end user machine which defeats the purpose of sharing single EXE file with user that doesn't know how to work with PowerShell. Any option that would pack all the dependencies in the same EXE?

Related