Posted  by  admin

Compile Ps1 To Exe


My.PS1 file need to receive on default parameters from files created inside of the folder where.EXE will be executed. Using the command line with parameter “Split-Path $MyInvocation.MyCommand.Path” my.PS1 work as well but when i try execute to the.EXE file the command line return to me the information of this parameter “Split-Path $MyInvocation.MyCommand.Path” as “C: ”.

Compile ps1 to exe
    • Hi all. As mentioned in another thread somewhere here, I’ve switched from Autoit to Powershell for pretty much all of my scripting. Anything truly automated I use PDQ Deploy for. We have a number of applications that we don’t necessarily deploy automatically, but are “as-required” and the users just launch the install from a shared folder. In the past the shared folder had a shortcut to the compiled Autoit script. Now we have a shortcut to a .cmd file that launched the powershell script like:
      Powershell -file “servershareproductinstallscript.ps1”

      This works just fine, but seems a bit, well, sloppy. I could compile the Powershell like I did with Autoit. How does everyone else handle launching ps1 files?

    • Hi Steve, great question. I think a cmd file is pretty standard, but agree it isn’t the best presentation for an end user. This was actually the original problem I was trying to solve with the Script Packager feature of the Admin Script Editor. Some scripts need a command line interpreter, and other possible external dependancies which even make delivery even more of a challenge. PowerShell isn’t a language that can be “compiled” but it (and anything really) can be packaged. The result is essentially a self extracting executable that cleans itself up after running out of the %temp% folder. It doesn’t sound like your environment is locked down, but the feature also supports the setting of alternate credentials so that users that don’t have permission to install the software, could do so without prompting.

      Or see the Script Packager closer in this video:

    • The way the ASE Script Packager handles arguments is that it exposes it as an environment variable you can parse in your script. The full command line is to be handled as a string by reading %ASEEXEARGS% where you can take actions based on what you find accordingly.

      Having %temp% locked down is rather unusual, this is the default target for extraction and execution because most every user is able to write here– if you have designated another location for such it can be specified in the settings for the Script Packager.


Email: [email protected] Skype: P i P Crypt Crypter Encrypt Trojan Buck files Malware virus programming languages VB.NET & C# & C & AutoIT & V6 NAJRAR. SO I was thinking of some fun things to do with it, getting reverse shells, dumping passwords with mimikatz, compiling.cs files etc to evade AV and whitelisting. It’s fairly simple to do,here’s an example of a powershell reverse shell: just press ctrl+r, type in iexpress and hit enter. Chose the first selection and hit next.

Compile Ps1 To Exe

Register here