PS2EXE : "Convert" PowerShell Scripts to EXE Files

This PowerShell script lets you "convert" PowerShell scripts into EXE files.

4.5 Star
54,519 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Version Error
    2 Posts | Last post September 08, 2017
    • We are running powershell version 5.1.  When I try to run your converter, it returns the error "THE POWERSHELL VERSION IS UNKNOWN!".  I redownloaded the above zip, but same issue.  Please advise.
    • Hello dottkp,
      it seems that Ingo Karstein does not improve his script anymore. So you have two choices:
      1. Change line 74 of ps2exe.ps1 from
      if($PSVersionTable.PSVersion.Major -eq 4) {
      if($PSVersionTable.PSVersion.Major -ge 4) {
      2. Use one of the further developments of ps2exe
      The one from Rengifo, from Stuart Dootson or mine (
  • Problem with modules after compilation.
    1 Posts | Last post August 23, 2017
    • Sorry in advance if I haven't found answer to this question - I searched though.
      The issue is that when I run my script as .ps1 - all modules, GUI and functionality behaves as intended, though if I compile it to .exe - modules seems not to be working. All the functionality, except parts where scripts needs to work with PSRemoteRegistry and Quest AD snippet, works.
      Is there something in exe config file I am missing? Or something in compilation script I need to amend/alter?
  • virus detection
    1 Posts | Last post August 22, 2017
    • I have been using this to create exe and it works great.  but recently, my scripts are getting caught as trojans?  If i submit my ps1 to vt, it is clean, but if i submit my exe to vt it comes back with a detection.  is there something i need to do to avoid this.
  • There is an issue with adding an icon
    1 Posts | Last post August 09, 2017
    • Providing an icon filename results in errors unless I place it in the c:\Windows\System32.  The problem appears to start at line 218:
      $iconFileParam = ""
      if(!([string]::IsNullOrEmpty($iconFile))) {
      	$iconFileParam = "/win32icon:$($iconFile)"
      This will always result in the $iconFileParam resolving to the c:\Windows\System32 directory if you provide a file name.  I modified it to the following and it worked as expected:
      $iconFileParam = ""
      if(!([string]::IsNullOrEmpty($iconFile))) {
      	$iconFileParam = (join-path (split-path $inputFile) $iconFile)
  • Using PS2EXE safely?
    4 Posts | Last post August 07, 2017
    • I compiled a ps1 file with this script and I have started to receive the trojan warning from the database update of ESET.
      is this a false positive or something wrong
      Threat :MSIL/CoinMiner.ABB
    • I'm getting the same error. I still can't find the solution. I will try contacting ESET about this.
    • If you find a solution or answer. Please Write here. Thank you.
    • After updating the Eset database no more errors.
  • Tasks
    2 Posts | Last post July 24, 2017
    • Hi 
      In first sorry for my english :)
      I try to protect my code by using your program but i have some issus when i try to use it with Windows Task Scheduler and arguments
      I try to launch 
      C:\TEMP\Program.exe -arg1 test -arg2 test2 / the program start but stop immediatly
      C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\TEMP\Program.exe -arg1 test -arg2 test2 / works
      Without Windows Task Scheduler the EXE work
      Can u help me ?
    • New test :
      if i lunch Windows Task with .EXE without "-noconsole" it's works...
  • Encapsulating Files
    1 Posts | Last post July 23, 2017
    • PowerGUI from Quest allows you do add files to the exe so that when the exe runs, it expands into a temp directory and all files are there for the ps1 to see.
      Any chance this tool does that and if not, can it be added?
      MSI files are a prime example of a file a ps1 may need to open.
  • Updated version for PowerShell 5
    2 Posts | Last post July 13, 2017
    • do you have updated version of this script compatible with PS version 5. 
    • Hello aljaf,
      please see my answer to the question "Update for PowerShell 5.0?" from rogertheheart (2017/03/30) below.
  • No output after compile, no log don't know where to start
    1 Posts | Last post June 30, 2017
    • Hi,
      I just wrote my first Powershell script and I would like to compile it, it seems to work fine but when running the .exe I get no output.
      I'm sourcing a file with variables (as $1) and the vSphere POWERCLI at the start of the script, I think this might be the problem. It works as a .ps1 file but the .exe doesn't seem to source the vSphere POWERCLI. Any way to get this to work?
  • Exe hangs on parameterized script conversion
    2 Posts | Last post June 16, 2017
    • The exe runs fine when values are hard coded, but if the parameters are prompted the script hangs right after the values are entered. 
      The test script I'm using
      echo $server
      When running the exe the prompt comes up okay but nothing happens after the value is entered. Is this behaviour expected or am I missing something.
    • Hello xja888,
      hope it's fine for Ingo that I answer this question :-)
      There is a bug in PS2EXE with computing input. You have two choices to work around this:
      1. Open PS2EXE.ps1 with a text editor and replace the content of line 1283:
      powershell.BeginInvoke<PSObject, PSObject>(inp, outp, null, new AsyncCallback(delegate(IAsyncResult ar)
      powershell.BeginInvoke<PSObject, PSObject>(null, outp, null, new AsyncCallback(delegate(IAsyncResult ar)
      There may be side effects (but I do not think so).
      2. Use my overworked version of PS2EXE, it has this error fixed (amongst others):
1 - 10 of 77 Items