mscholtes / win-ps2exe Goto Github PK
View Code? Open in Web Editor NEWGraphical frontend to PS1-to-EXE-compiler PS2EXE.ps1
License: MIT License
Graphical frontend to PS1-to-EXE-compiler PS2EXE.ps1
License: MIT License
Attempting to run Win-PS2EXE.exe as Administrator, compiling a simple PowerShell script (Write-Host "This is a test") and Avast antivirus is marking the .EXE output file created as a virus (screenshots attached). No matter what PS script I attempt to compile, Avast doesn't like it. What am I doing wrong, or should I simply turn off Avast when compiling?
PC is Windows 10, latest .NET version, PowerShell 7 is installed, but this simple code doesn't use new PS7 features. I have run virus check on the entire PC not just select files and no virus was found.
Thank you in advance for your help.
-Chuck
Great program but need the compiled exe to work across the Windows platform regardless of the .Net version without having to recompile the powershell script for each variance. Is there an update that will do that or is that not possible?
Currently, it appears the executables produced by Win-PS2EXE are able to accept an "extract" switch which allows end users to extract the original PowerShell script from the executable. Would it be possible to add a checkbox option in the GUI for generating executables that do not contain this option?
Hi,
Great app BTW use it all the time but I have noticed that I seem to get a lot of issues when I have compiled my scripts mostly around the invoke-command cmdlets when executing on remote systems.
This is great for basic powershell GUI's / Scripts but once they get more in depth it will throw errors where there were none before when executing the ps1 files.
I also noticed some issues around the Try{} Catch{} when doing error handling.
Is this something i'm doing wrong? any info would be appreciated thanks.
Kind Regards
Surfer
Generated a script that, among lots of other things, searches for hidden files with specific extensions.
Here's the code:
if ( !(dir -Path "c:\users" -name '.mp3' -Recurse -Force) -and !(dir 'c:$Recycle.bin' -name '.mp3' -recurse -force) ) {echo "There are NO hidden mp3 files"}
Then, used win-ps2exe to generate a compiled executable and configured a service to use srvany.exe to execute that script as SYSTEM.
When run, the compiled version doesn't find those files when they are there. But, when I change from SYSTEM to an administrative user's credentials, those files are found.
This would indicate that the LOCAL SYSTEM account can't 'see' hidden files - which shouldn't be $true.
I'm making the jump that it may have something to do with how the script was compiled. I tried all the different ways available on this gui to configure the compiled executable but still get the same issue.
Hello,
I received this message when trying to compile in the .Net 4.X version
`Microsoft (R) Visual C# Compiler version 4.8.9037.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
Press any key to continue . . .`
Then If I run it in the .Net 3.5 folder included
`Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.9151
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
Press any key to continue . . .`
Both Compile attempts result in no GUI exe.
I am running Windows 11 64bit in a Virtual Machine. I will try on a Windows 10 PC later when I get time.
.Net Framework 2.0,3.0, 3.5,4.8.1 are installed.
Any and all help is greatly appreciated!
I want to use ps2exe as part as my code and call a method to do it instead of my current solution.
Currently what I've done was to compile ps2exe.ps1 using itself, allowing me to use that exe to compile other PowerShell scripts.
I have a software which uses it, I write down a piece of PowerShell code during runtime and I compile it to an exe.
The issue I currently have is when I use the start process method to actually use it, I have some issues with.
There is an error in the *.cs file.
When compiling, it shows an error.
I have a PS script that does some stuff with PoshRSJob, AD cmdlets and Graph API rest calls and then spits out a report file. It works great when converted to EXE however if I run the EXE using shift+right click >run as different user, when the process is done it remains hanging in my task manager and still running. I have to kill it manually. If I run the EXE by simple double click it exist at completion as expected.
I tried with another PS script that isn't so advanced and it does close running under different user. I've placed "exit" all over my PS script but it's not quitting when done.
Side note, I am loading another ps1 in to get some functions but even that file I threw an exit at the end.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.