简体   繁体   中英

Convert a PowerShell script to exe Including an Exe file into it

I have a few Powershell scripts that I use to copy files and run installations with the required install steps included in the sript, i know how to convert these scripts into exes. I would like to know, how to include the files I am installing with the script in the powershell converted exe?

This utility on github has proven very useful to me:

https://github.com/rzander/PS2EXE

It comes with a pretty straightforward GUI and command-line version, but only works with one PowerShell file.

I have modified a personal version to take multiple files and combine them into one executable. Let me know if you're interested and I can upload it.

I would like to answer my own question for whom ever come across the same issue or need, I had the way of doing this all along: but I didn't pay attention to details. For what I required which is to convert a,PS1 script that installs postgresql unattended. to an.exe file including(Postgres enbedded in the exe).

The best tool for this is the "PS1 to EXE" https://gallery.technet.microsoft.com/PS1-To-EXE-Generator-d39e8be2 software, 1. Load your ps1 file, make sure everything is working before hand. 2. Embed the the files you need for the ps1 to work (embed option is on the right column next to the "Options")

Then you can click the convert option PS: Be sure to have the correct file path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM