For Merge-Script, I changed it to “net6.0” and this time worked. Thanks for that. EXE runs fine.
QUESTION: What is the ConfigFile keyword for renaming the exe?
For Visual Studio 2022, I deleted the Release folder, the exe was created, however it does not run either. Even though I am converting the same PS1 script, I found that the exe created using merge-script is 100,004 KB and the exe created with Visual Studio is 98,028KB in size. Should that be the difference while one runs and not the other?
Another thing I noticed is that the ApplicationIconPath parameter is being ignored. It works for Windows Powershell 5.1 but not for .NET Core and PWSH 7.2. The same with the other details: File Description, File Version, Product Name, Product Version, Copyright. They are all ignored.
I have one EXE created a while ago with netcoreapp31 and PWSH 7.1, and the exe details are all included, even the icon.
I’ve opened issues for both of these items (file details and VS not recompiling). The files should be the same size between the two as it should be using the same settings in the compiler. I don’t know why one would be smaller than the other.
By the way, in case this is helpful to anybody else or could help improve how Merge-Scripts works, I could not get my PowerShell 7 script to build until I manually installed Microsoft.PowerShell.SDK via Nuget:
We should open an issue for this. We have tests running to verify this functionality but there must be a gap in the test case since you shouldn’t have to install it manually.