PS2EXE-GUI: "Convert" PowerShell Scripts to EXE Files with GUI

Overworking of the great script of Ingo Karstein with GUI support. The GUI output and input is activated with one switch, real windows executables are generated. With Powershell 5.x support and graphical front end. Now here: https://github.com/MScholtes/TechNet-Gallery

PS2EXE-GUI.zip
 
 
 
 
 
4.7 Star
(38)
36,815 times
Add to favorites
7/11/2020
E-mail Twitter del.icio.us Digg Facebook
  • GUI/Messagebox issue
    3 Posts | Last post December 16, 2019
    • Hi marcus
      
      I've posted an issue on Github as I can't attach images here
      
      Thanks
    • Hello Scepticyn,
      
      I saw the issues, the one with Win-PS2EXE will be easy to fix, the other one not. Have to think about it if there's an reasonable way to work around since it is a "seldom" issue.
      
      Greetings
      
      Markus
    • Hello Scepticyn,
      
      the new version 0.5.0.18 of PS2EXE addresses your issues. For PS2EXE I followed the Windows approach of first selecting 5/8 of the screen as the maximum size of a window. In Win-PS2EXE I just fixed the field size.
      
      Greetings
      
      Markus
  • Symantec Threat Detected while using the GUI
    2 Posts | Last post December 14, 2019
    • Hi, 
      
      I love the GUI and the way it is helpful in the changing the PS file to exe. but in the past couple of days I have been seeing issues while scanning the PC with Symantec Antivirus as Security risk detected:"Heur.AdvML.B". and it is deleting the exe automatically from the PC to protect the PC. I am using Symantec Endpoint protection antivirus 14.2 RU1 MP1. 
      
      Kindly suggest how can overcome this issue when we use the GUI method for creating the exe. 
      
      Thanks
      Balaji S
      
    • Hello Balaji,
      
      there is not much we can do. I sent two example files to VirusTotal and there was an detection rate of 4 from 64 respectively 9 from 64. 
      The reason for this is that PS2EXE compiles scripts to executables. This is suspicious! For some scanners it is suspicious enough to block.
      
      The only possibility is to use your contact to Symantec to upload an sample so they check it is not dangerous.
      
      Greetings
      
      Markus
  • Have you considered uploading the module to PowerShell Gallery?
    2 Posts | Last post December 13, 2019
    • Hi, I love your script. I was wondering if you'd considered uploading it as a module to https://www.powershellgallery.com ? 
      
      This would allow for easier installation of the module and version control. I'm not sure if it would be feasible with your particular module (not sure what the requirements are or if it would need to be redesigned / repackaged), but I thought it would be worth mentioning anyways.
      
      Either way, thanks again for your awesome script!
    • Hello Jeffrey,
      
      please read the Description page, there are the instructions and the links to PowerShell Gallery (https://www.powershellgallery.com/packages/ps2exe) and GitHub (https://github.com/MScholtes/PS2EXE) for the module Version.
      
      Greetings
      
      Markus
  • Can't run exe created in Win10 on Win7 Machine
    2 Posts | Last post November 13, 2019
    • I have a script that I would like to package using PS2EXE and be able to run it on Win7 or Win10 without a config file. All computers I will run it on will have .NET4 so I would like to be able to specify the requirements as Powershell2 and .NET4.
      
      Currently if I build the exe on Win7, I can run it on win10 but I get a prompt to install .NET2/3.5. If I use a config file with .Net4 specified it will run fine on Win10 without installing .NET2/3.5 but I would prefer not to have to distribute a config file with the exe.  
      
      If I build the exe on Win10 and try to run it on win7 I get an error that the program has stopped working and I see the following error in the console.
      
      Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. at ik.Powershell.PS2EXE.Main(String[] args)
      
      Is there a way to specify requirements as Powershell2 and .NET4 so it will run on win7 or win10 running .NET4?
    • Hello KMarryat,
      
      when I understand your environment correctly you try to do something that cannot function:
      - PowerShell Version 2 works only with .Net 2 or .Net 3 and NOT with .Net 4
      - PowerShell Version 3 or up is NOT included in .Net 4
      
      You have two choices when you want to use one binary:
      - install .Net 3 on Windows 10 and use PowerShell V2 there with a config file that enforces PowerShell 2
      - install WMF 5.1 on Windows 7 so you can use PowerShell V5.1 there with a config file that enforces PowerShell 5.1
      
      Greetings
      
      Markus
      
  • Support for german Umlaute (special cases)
    2 Posts | Last post November 09, 2019
    • Hello Markus,
      
      thank you for overworking and maintaining this project, very much appreciated.
      
      Im using ps2exe for converting a powershell script with a gui to a standalone .exe. The GUI is build with System.Windows.Forms-elements, so nothing out of the ordinary.
      
      However, after compiling to an .exe-File german special cases / "Umlaute" like äöüß are not displayed correctly anymore. Instead, these characters are displayed like "?". 
      
      It seems like there is a change of encoding going on in the encapsulating process and the new charset does not support these characters. 
      
      Are these special characters supported?
      
      Regards,
      Jakob
      
      
      
      
      
    • Hello Jakob,
      
      PS2EXE can handle special characters like Umlauts  but expects the source file to be UTF8 oder Unicode encoded. Please convert your source file before compiling, for example with
      
        gc .\sourceASCII.ps1 | sc sourceUTF8.ps1 -Encoding UTF8
      
      Greetings
      
      Markus
      
  • How to add an icon file
    2 Posts | Last post November 06, 2019
    • Hello,
           I wrote a PS script and it compiles and works as expected.  Without the .ico file, i can compile the script and create an app without any issue. How do i add an .ico file in the application. Below is the error i get when i compile with the .ico file.
      Below is the error. Any help would be appreciated. 
      
      PS2EXE-GUI v0.5.0.16 by Ingo Karstein, reworked and GUI support by Markus Schol
      es
      
      You are using PowerShell 4.0 or above.
      
      Reading input file C:\PS2EXE-GUI\ECKOH_TOGGLE\ECKOH_TOGGLE.ps1
      Compiling file...
      
      C:\PS2EXE-GUI\ps2exe.ps1 : Could not create the PowerShell .exe file because
      of compilation errors. Use -verbose parameter to see details.
      At line:1 char:1
      + & 'C:\PS2EXE-GUI\ps2exe.ps1' -inputFile 'C:\PS2EXE-GUI\ECKOH_TOGGLE\E ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
         tion
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
         n,ps2exe.ps1
      
      VERBOSE: warning CS1668: Invalid search path 'C:\Sybase32\LIB' specified in
      'LIB environment variable' -- 'The system cannot find the path specified. '
      VERBOSE: error CS1567: Error generating Win32 resource: Error reading icon
      'c:\PS2EXE-GUI\logo-x2.ico' -- The data is invalid.
      
      Press Enter to leave:
    • Hello Maheswar Tamang,
      
      please read the error message and correct the environment variable LIB, where a non existing path C:\Sybase32\LIB is specified.
      
      Greetings
      
      Markus
  • Can I run Compiled.exe file in Windows RE?
    2 Posts | Last post November 04, 2019
    • Hello Markus.
      
      Can I run Compiled.exe file in Windows Recovery Environment?
      
      I have tried and get no output or error.
      
      Also thanks very much for Win-PS2EXE gui update.
      
      Greetings
    • Hello Minh Cường,
      
      this does not work since there is no PowerShell installed in Windows RE.
      
      There are some instructions on how to install PowerShell in Windows RE on the web but it is quite difficult.
      
      Greetings
      
      Markus
      
  • file.exe
    2 Posts | Last post October 30, 2019
    • When I run by Win-PS2EXE.exe returns the file .exe was generated successfully, however when checking the path which is supposed to be there the file is not there.
      
      I am using Windows 10
      
      BR
    • Hello PauloGuimares,
      
      Microsoft has finally solved the problem of the missing questions so that I can answer now:
      
      Can you please tell me in which path Win-PS2EXE.exe, ps2exe.ps1 and the script to compile are? Which version of ps2exe.ps1 you are using?
      
      Greetings
      
      Markus
  • very long path syntax issue
    2 Posts | Last post October 30, 2019
    • After compiling below script, and run. It will throw out an exception. Any way to fix it?
      
      Get-ChildItem -literalpath \\?\C:\
      
      It works well in powershell 5.1
    • Hello rocklee,
      
      Microsoft has finally solved the problem of the missing questions so that I can answer now:
      
      Please use the switch -longPaths to enable this functionality. The config file has to be in the same directory as the executable so this works.
      
      Greetings
      
      Markus
  • How can I get exe path in powershell code?
    2 Posts | Last post October 30, 2019
    • How can I get exe path in powershell code?
      Then I compile ps1 to exe $script:MyInvocation.MyCommand.Path is empty ...
      I can use parameter but sometimes it is undesirably
    • Hello Kuznetcovay,
      
      Microsoft has finally solved the problem of the missing questions so that I can answer now:
      
      Please see the comment "Script variables:" in the "Remarks" section of this web page.
      
      Greetings
      
      Markus
11 - 20 of 184 Items