Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Convert PowerShell ps1 to EXE using native windows tool iexpress

Some times it is essentials to convert your codes to EXE. In my scenario when I try to provide script to end users and if I expect them not to modify the script before running or executing it, I can convert any cmd bat or PS1 script to EXE easily using Native Windows Tool called iExpress.exe, and export them. This tool is very handy for normal ps1 script to convert to EXE.

You can launch the program just typing iExpress in the run. it is advised to run it as administrator.

In the IExpress Wizard Create new Self Extraction Directive file. SED file store information about this package. If you have already done this, select Open existing one. otherwise select Create New Self Extraction Directive file, Next select Package purpose as Extract files and run an installation command, Files will be expanded to temporary folder.

Type the Title of your package in the box this title will appear on all dialog boxed that the user sees. For confirmation prompt select no prompt.

Choose the Do not display a License agreement.

This is critical step, In the Packages files create a list of files that you want in your compressed package. Click add button and add ps1 files and all the supportive files.

Once files are added you need to provide how the script will launch as like below command in the Install Program to Launch wizard, There is no post install command.

powershell.exe -ExecutionPolicy Unrestricted -File SystemInfo.ps1

Show window is set to Default recommended by default. No messages will be displayed after Finished message option.

Give a Package name. Configure restart to no restart. In the Save self Extraction Directive (SED) I am selected to not save the file. Go with the creating EXE file.

You can view the summary of created package. it is successful. You can execute ps1 exe file to check the results.

Useful Articles
Microsoft PowerShell: Check Windows license activation status
Find next available free drive letter using PowerShell
Copy Files with PowerShell Remoting WINRM Protocol
Powershell Find application window state minimized or maximized
How to Install and Use Microsoft PowerShell on Linux
Configure PowerShell remoting between Windows and Linux
Get-PSRepository WARNING Unable to find module repositories
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send
Creating an internal PowerShell module repository
How to sign PowerShell ps1 scripts
PowerShell Convert MAC address to Link-local address IPv6
PowerShell fix repair The trust relationship between this workstation and the primary domain failed
Resovled issue with PowerShell - Trust relationship Rejoin computers in domain without restart



This post first appeared on Tales From Real IT System Administrators World And Non-production Environment, please read the originial post: here

Share the post

Convert PowerShell ps1 to EXE using native windows tool iexpress

×

Subscribe to Tales From Real It System Administrators World And Non-production Environment

Get updates delivered right to your inbox!

Thank you for your subscription

×