PS2EXE | Module to compile powershell scripts to executables

 by   MScholtes PowerShell Version: Current License: Non-SPDX

kandi X-RAY | PS2EXE Summary

kandi X-RAY | PS2EXE Summary

PS2EXE is a PowerShell library. PS2EXE has no bugs, it has no vulnerabilities and it has low support. However PS2EXE has a Non-SPDX License. You can download it from GitHub.

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. You find the script based version here (and here: PS2EXE-GUI: "Convert" PowerShell Scripts to EXE Files with GUI.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              PS2EXE has a low active ecosystem.
              It has 718 star(s) with 131 fork(s). There are 33 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 96 have been closed. On average issues are closed in 29 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of PS2EXE is current.

            kandi-Quality Quality

              PS2EXE has 0 bugs and 0 code smells.

            kandi-Security Security

              PS2EXE has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              PS2EXE code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              PS2EXE has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              PS2EXE releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PS2EXE
            Get all kandi verified functions for this library.

            PS2EXE Key Features

            No Key Features are available at this moment for PS2EXE.

            PS2EXE Examples and Code Snippets

            No Code Snippets are available at this moment for PS2EXE.

            Community Discussions

            QUESTION

            Script calls other script as .ps1 but not as a .exe using ps2exe
            Asked 2022-Feb-15 at 16:13
            $password = ConvertTo-SecureString “Password+++” -AsPlainText -Force
            $Cred = New-Object System.Management.Automation.PSCredential ("Admin", $password)
            $FileLocale = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
            Write-Output $FileLocale
            $AntFile = "$FileLocale\StartApps.ps1"
            Write-Output $AntFile
            Start-Process PowerShell.exe -ArgumentList "-command &$AntFile -UserCredential $Cred"  
            
            ...

            ANSWER

            Answered 2022-Feb-15 at 16:13

            While an executable compiled with ps2exe uses a .ps1 file as input, at runtime no actual .ps1 file is involved, which is why PowerShell's command-reflection variables cannot tell you anything about a running script file.

            When running an actual .ps1 file, you'd use the following about_Automatic_Variables:

            • $PSCommandPath contains the the executing script file's full file path.

            • $PSScriptRoot contains the script file's full directory path (i.e. the full path of the directory in which the script file is located).

            In a ps2exe-compiled executable (.exe), where these variables have no values, you can use the following instead:

            • [Environment]::GetCommandLineArgs()[0] contains the executable file's full file path.

            • Split-Path -LiteralPath ([Environment]::GetCommandLineArgs()[0]) contains the executable file's full directory path.

            Applied to your code - assuming that a separate StartApp.ps1 file is present alongside your .exe file:[1]

            Source https://stackoverflow.com/questions/71127896

            QUESTION

            Is there a way to start a file with my PowerShell compiled script per double click?
            Asked 2021-Nov-25 at 17:38

            I have created a PowerShell script and then compiled it with PS2EXE. The program loads *.JSON-files and allows the user to edit it. The program starts with a file browser window to select the right *.JSON to load.

            Now I want to try to run the program by double-click a *.JSON and skip the file browser window. So I right klick the file > select open with > and choose mypowershellapp.exe and inspected the $PWD var. But it was always the system32 directory.

            So: How to get the file path the program was started from?

            ...

            ANSWER

            Answered 2021-Nov-25 at 17:38

            Indeed: when you use File Explorer's Open with... shortcut menu and select an application to pass the document at hand to, that application invariably launches with C:\Windows\SYSTEM32 as its working directory.

            However, the document at hand is passed as an argument by its full path, so you can infer the directory it is located in.

            That is, in your (compiled) *.ps1 script, do something like the following:

            Source https://stackoverflow.com/questions/70110535

            QUESTION

            How can I use xml for Powershell GUI to get version num of PS tool?
            Asked 2021-Sep-12 at 04:42

            I have recently started learning to use xml with Powershell to create GUIs. My goal is to create an about box. I use VSCode and Notepad++ (No fancy Visual Studio for me, can't get approved for a license). What I have not yet been able to figure out is how to get the version number of my powershell tool into the xml so it can be displayed. Here are a few code snips

            ...

            ANSWER

            Answered 2021-Sep-01 at 15:32

            Use an easily identifiable template string in the base XML and just replace that with the version in the file as a build step. In your XML, change the Text attribute of the XML element to use a replaceable value, such as {{VERSION_NUMBER}}:

            Source https://stackoverflow.com/questions/69016111

            QUESTION

            Setting Variable Before Out-Null While Suppressing Output PowerShell
            Asked 2020-Oct-21 at 17:04

            I am trying to suppress the output of a command while setting a variable. I need to do this because I have compiled the PowerShell Script using PS2EXE-GUI. This program shows all command output on a seperate window, which is very annoying and is not necessary. I am trying to use Get-ChildItem "$MYSQLFOLDERLOCATION" | Out-String | Write-Host, but this only works when there is nothing in the directory, anything else, and it shows the directory contents on the screen. I have also been trying to use Get-ChildItem "$MYSQLFOLDERLOCATION" | $ISMYSQLFOLDERPRESENT = $? | Out-Null, but this is syntactically incorrect. Is there something similar to this that I can use? I basically want to do an ls-equivalent command in PowerShell, then store whether it succeeded or not, while not showing anything on screen (I can't use Write-Output, Write-Host, etc.)

            ...

            ANSWER

            Answered 2020-Oct-21 at 17:04

            You need to assign the entire expression to a variable - otherwise any resulting output will "bubble up" to the caller and you'll see it on the screen:

            Source https://stackoverflow.com/questions/64468186

            QUESTION

            Trying to compile the powershell script to exe with parameters
            Asked 2020-Jul-09 at 08:24

            Im looking to convert my ps1 to exe. it has to be some kind of a compiler that can accept parameters since i would like this exe file to be a bit different some times. for example i may have inside the script:

            ...

            ANSWER

            Answered 2020-Jul-09 at 08:24

            My Solution was:

            1. Create Template script, whatever needed to be changed from the template mark as something like '@@@var1@@@'
            2. Create another script to accept variables.
            3. Get-content of the template script and use -repalce method to replace what is needed in the template script.
            4. Compile the newly created script with Ps2Exe

            Source https://stackoverflow.com/questions/62755714

            QUESTION

            PowerShell Script working with Excel COM Object buffering on different Clients
            Asked 2020-Mar-30 at 08:55

            I created a fairly big PowerShell Script working with the Exce COM Object to Output Data it read into some .ini files. I converted the Script to .exe with the Win-PS2EXE Programm.

            When I start the Script on my Fujitsu PC it creates and then populates the Files. When my Collegue uses it on his Lenovo, the files get created (So it can't be a filepath problem) but there isn't any data that gets written into them.

            My Fujitsu

            • Windows Version 10.0.017134 Build 17134 (Everything is the Same)
            • PowerShell Version 5.1.17134.858 (Everything is the Same)
            • All Excels fully closed
            • No Clicking around when it's taking a while
            • Script version 3.8
            • Microsoft 360 Account with newest Excel
            • Same Excel File Used

            His Lenovo

            • Windows Version 10.0.017134 Build 17134 (Everything is the Same)
            • PowerShell Version 5.1.17134.858 (Everything is the Same)
            • All Excels fully closed
            • No Clicking around when it's taking a while
            • Script version 3.8
            • Microsoft 360 Account with newest Excel
            • Same Excel File Used

            The Script itself works. It was tested and debugged over multiple Months and it always worked (on multiple, different systems) with no Errors. Where could the problem be or what could I try to do?

            ...

            ANSWER

            Answered 2020-Mar-30 at 08:55

            So, I don't know why or how, but the Excel itself is broken after I transfer it to his PC. (All Permissions etc. are set so that the excel works and everything.)

            I copied the Data in the Excel into a new Excel File, which I transferred the same way again (Network Folders). This time it worked.

            All in all, the Excel File itself has some Corruption. I may look into it and if I find a Solution I'm going to post it here.

            For now I know the Script has no Error and works on all other Systems.

            Source https://stackoverflow.com/questions/60633005

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install PS2EXE

            (on Powershell V4 you may have to install PowershellGet before) or download from here: https://www.powershellgallery.com/packages/ps2exe/.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/MScholtes/PS2EXE.git

          • CLI

            gh repo clone MScholtes/PS2EXE

          • sshUrl

            git@github.com:MScholtes/PS2EXE.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular PowerShell Libraries

            Scoop

            by ScoopInstaller

            scoop

            by lukesampson

            blazor

            by dotnet

            PowerSploit

            by PowerShellMafia

            Try Top Libraries by MScholtes

            VirtualDesktop

            by MScholtesC#

            TechNet-Gallery

            by MScholtesPowerShell

            PSVirtualDesktop

            by MScholtesPowerShell

            Win-PS2EXE

            by MScholtesC#

            WebServer

            by MScholtesPowerShell