PS2EXE.Core has been released

PS2EXE.Core has been released

Hi All,

Just a few days ago, my fellow PowerShell MVP Fabien Tschanz has released the first Versions of PS2EXE.Core to the PowerShell Gallery.

The Project is hosted in GitHub - feel free to participate and improve this young Project.

Find Module in PowerShell Gallery and install it

Find-PSResource -Name PS2EXE.Core
Install-PSResource -Name PS2EXE.Core -Scope CurrentUser

List Commands of the Module

Get-Command -Module PS2EXE.Core

I’ve created a very simple PowerShell Script

$Date = get-date -f "yyyy-MM-dd HH:mm:ss"
Write-Host "It is: $Date"

Converted that to an *.exe with the following command

Invoke-PS2EXE C:\Temp\PS2EXE.Core\demo.ps1 C:\Temp\PS2EXE.Core\demo.exe

As you can see the exe is still very small with 25KB

I’ve started the exe in cmd. When you use the -wait parameter at the end it will show “Hit any key to exit…”

I even added an Icon File

Invoke-PS2EXE C:\Temp\PS2EXE.Core\demo.ps1 C:\Temp\PS2EXE.Core\demo.exe -IconFile C:\temp\PS2EXE.Core\Powershell_av_colors.ico

Now the exe has the Icon and is exact the size of the icon file bigger

If you use “start” in cmd it opens up in a new window

start demo.exe -wait

Now you can even see the Icon in the Taskbar.

Summary

I have absolutely no clue how that works - but it works and there are very cool use cases out there. Hope you like that and support the Project 😎

Note: Don’t put any Secrets or Passwords in your Script files. The Exe can be converted back to a PowerShell File.

Regards
Andres Bohren

PowerShell Logo