Compiling PowerShell 7 Scripts into a Executable in VS Code

We just (re)released support for packaging scripts in PowerShell 7. It works cross-platform.

Adam, I can see the new value for DotNetVersion value (netcoreapp31) in Package table. Also there is a new key ‘PowerShellVersion’. What are the valid values for both?

Besides, will I now be able to bundle the Powershell Core runtime within the executable when specifying PowerShellCore = $true? That wasn’t working properly before.

Please advise.

The valid values are listed here: https://docs.poshtools.com/powershell-pro-tools-documentation/packaging/package.psd1#config-file-schema

To compile for PS7, you will need to set:

PowerShellVersion = ‘7.0.0’
DotNetVersion = ‘netcoreapp31’

I tried the above and it is erroring in multiple ways.

My environment is:
PS Core 7.1.5
Core SDK 3.1.414

If I enter version 7.1.5 I get the below error.
Merge-Script: Invalid version specified. This parameter supports ‘Windows PowerShell’, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.0.6

I am trying to package a script I have built but it just fails.

Please advise.

We don’t support version 7.1.x in the current version due issues with the .NET single file packaging. This will be implemented in the October release cycle due out the 9th.

OK,
Thank you

Adam,

I am trying to compile a PS1 that uses Windows Forms into dotnet core executable. I currently have PS Tools 2021.11.0, PWSH 7.2.0 and .NET 6.0 installed (VS 2022 environment). In the PSD1 I tried all versions from 7.1.0 to 7.1.4 (7.1.5 nor 7.2.0 are supported in PS tools 2021.11.0), and I always get the same error

I have all intermediate files created in %TEMP% so let me know if you required them.

Please advise.

It’s likely an issue with targeting .NET 6. Try setting the target framework to net5.0.

How is the Target Framework changed? I have it as netcoreapp31 in the PSD1.

In the PSD1, you should be able to change that to net5.0

I changed it to NET50 and got the following error

I saw it was still using SDK 6.0 so I uninstalled it from VS2022, and tried again, with a different error this time.

I give up for now. I will wait until you make it work with .NET SDK 6.0. In the meanwhile, I will create a WIndows Powershell 5.1 EXE.

Sorry the .NET Version should be “net5.0” not “net50”

Adam, I changed to net5.0 and this time no errors were given, however the output folder changed from “empty” to a folder with 339 items (see below). The EXE was created but when I run it no output is displayed, nothing happens.

From:

To:

The verbose output is as follows:

PS ManageSmartkeys [11/23/2021 20:16:58]> merge-script -ConfigFile ./ManageSmartkeys-Core.psd1 -verbose
VERBOSE: Checking license
VERBOSE: OutputPath is C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\Out
VERBOSE: Bundling C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.ps1
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ListSmartkeys.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.designer.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.resources.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\SmartkeyName.designer.ps1.
VERBOSE: Packaging C:\Temp\ManageSmartkeys.ps1
VERBOSE: Creating temp directory: C:\Temp\bc20a568b2d54023964299595212af9f
VERBOSE: Packaging modules…
VERBOSE: Checking dotnet version.
VERBOSE: Checking dotnet version.
VERBOSE: 6.0.100
VERBOSE: 6.0.100
VERBOSE: Creating package project.
VERBOSE: Using .NET Framework version: net5.0
VERBOSE: Determining projects to restore…
Restored C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj (in 590 ms).
VERBOSE: Determining projects to restore…
Restored C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj (in 590 ms).
VERBOSE: Packaging C:\Temp\ManageSmartkeys.ps1 → C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\Out\ManageSmartkeys.exe
VERBOSE: Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore…
Restored C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj (in 576 ms).
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(147,5): warning NETSDK1137: It is no longer necessary to use the
Microsoft.NET.Sdk.WindowsDesktop SDK. Consider changing the Sdk attribute of the root Project element to ‘Microsoft.NET.Sdk’.
[C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj]
C:\Temp\bc20a568b2d54023964299595212af9f\ConsolePowerShellHost.cs(169,35): warning SYSLIB0012: ‘Assembly.CodeBase’ is obsolete: ‘Assembly.CodeBase and
Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.’
[C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj]
ManageSmartkeys → C:\Temp\bc20a568b2d54023964299595212af9f\bin\Release\net5.0-windows\win-x64\ManageSmartkeys.dll
ManageSmartkeys → C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\Out
VERBOSE: Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore…
Restored C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj (in 576 ms).
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(147,5): warning NETSDK1137: It is no longer necessary to use the
Microsoft.NET.Sdk.WindowsDesktop SDK. Consider changing the Sdk attribute of the root Project element to ‘Microsoft.NET.Sdk’.
[C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj]
C:\Temp\bc20a568b2d54023964299595212af9f\ConsolePowerShellHost.cs(169,35): warning SYSLIB0012: ‘Assembly.CodeBase’ is obsolete: ‘Assembly.CodeBase and
Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.’
[C:\Temp\bc20a568b2d54023964299595212af9f\ManageSmartkeys.csproj]
ManageSmartkeys → C:\Temp\bc20a568b2d54023964299595212af9f\bin\Release\net5.0-windows\win-x64\ManageSmartkeys.dll
ManageSmartkeys → C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\Out\

And this is the list of files produced in output folder:

Accessibility.dll
api-ms-win-core-console-l1-1-0.dll
api-ms-win-core-console-l1-2-0.dll
api-ms-win-core-datetime-l1-1-0.dll
api-ms-win-core-debug-l1-1-0.dll
api-ms-win-core-errorhandling-l1-1-0.dll
api-ms-win-core-file-l1-1-0.dll
api-ms-win-core-file-l1-2-0.dll
api-ms-win-core-file-l2-1-0.dll
api-ms-win-core-handle-l1-1-0.dll
api-ms-win-core-heap-l1-1-0.dll
api-ms-win-core-interlocked-l1-1-0.dll
api-ms-win-core-libraryloader-l1-1-0.dll
api-ms-win-core-localization-l1-2-0.dll
api-ms-win-core-memory-l1-1-0.dll
api-ms-win-core-namedpipe-l1-1-0.dll
api-ms-win-core-processenvironment-l1-1-0.dll
api-ms-win-core-processthreads-l1-1-0.dll
api-ms-win-core-processthreads-l1-1-1.dll
api-ms-win-core-profile-l1-1-0.dll
api-ms-win-core-rtlsupport-l1-1-0.dll
api-ms-win-core-string-l1-1-0.dll
api-ms-win-core-synch-l1-1-0.dll
api-ms-win-core-synch-l1-2-0.dll
api-ms-win-core-sysinfo-l1-1-0.dll
api-ms-win-core-timezone-l1-1-0.dll
api-ms-win-core-util-l1-1-0.dll
api-ms-win-crt-conio-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-filesystem-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-multibyte-l1-1-0.dll
api-ms-win-crt-private-l1-1-0.dll
api-ms-win-crt-process-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
clrcompression.dll
clretwrc.dll
clrjit.dll
coreclr.dll
createdump.exe
cs
D3DCompiler_47_cor3.dll
dbgshim.dll
de
DirectWriteForwarder.dll
es
fr
hostfxr.dll
hostpolicy.dll
it
ja
ko
ManageSmartkeys.deps.json
ManageSmartkeys.dll
ManageSmartkeys.dll.config
ManageSmartkeys.exe
ManageSmartkeys.pdb
ManageSmartkeys.runtimeconfig.json
Markdig.Signed.dll
Microsoft.ApplicationInsights.dll
Microsoft.CodeAnalysis.CSharp.dll
Microsoft.CodeAnalysis.dll
Microsoft.CSharp.dll
Microsoft.DiaSymReader.Native.amd64.dll
Microsoft.Management.Infrastructure.CimCmdlets.dll
Microsoft.PowerShell.Commands.Diagnostics.dll
Microsoft.PowerShell.Commands.Management.dll
Microsoft.PowerShell.Commands.Utility.dll
Microsoft.PowerShell.ConsoleHost.dll
Microsoft.PowerShell.CoreCLR.Eventing.dll
Microsoft.PowerShell.MarkdownRender.dll
Microsoft.PowerShell.SDK.dll
Microsoft.PowerShell.Security.dll
Microsoft.VisualBasic.Core.dll
Microsoft.VisualBasic.dll
Microsoft.VisualBasic.Forms.dll
Microsoft.Win32.Primitives.dll
Microsoft.Win32.Registry.AccessControl.dll
Microsoft.Win32.Registry.dll
Microsoft.Win32.SystemEvents.dll
Microsoft.WSMan.Management.dll
Microsoft.WSMan.Runtime.dll
mscordaccore.dll
mscordaccore_amd64_amd64_5.0.1221.52207.dll
mscordbi.dll
mscorlib.dll
mscorrc.dll
Namotion.Reflection.dll
netstandard.dll
Newtonsoft.Json.dll
NJsonSchema.dll
PenImc_cor3.dll
pl
PowerShell.Core.Instrumentation.dll
PresentationCore.dll
PresentationFramework-SystemCore.dll
PresentationFramework-SystemData.dll
PresentationFramework-SystemDrawing.dll
PresentationFramework-SystemXml.dll
PresentationFramework-SystemXmlLinq.dll
PresentationFramework.Aero.dll
PresentationFramework.Aero2.dll
PresentationFramework.AeroLite.dll
PresentationFramework.Classic.dll
PresentationFramework.dll
PresentationFramework.Luna.dll
PresentationFramework.Royale.dll
PresentationNative_cor3.dll
PresentationUI.dll
pt-BR
pwrshplugin.dll
ReachFramework.dll
ref
ru
runtimes
sni.dll
System.AppContext.dll
System.Buffers.dll
System.CodeDom.dll
System.Collections.Concurrent.dll
System.Collections.dll
System.Collections.Immutable.dll
System.Collections.NonGeneric.dll
System.Collections.Specialized.dll
System.ComponentModel.Annotations.dll
System.ComponentModel.Composition.dll
System.ComponentModel.Composition.Registration.dll
System.ComponentModel.DataAnnotations.dll
System.ComponentModel.dll
System.ComponentModel.EventBasedAsync.dll
System.ComponentModel.Primitives.dll
System.ComponentModel.TypeConverter.dll
System.Configuration.ConfigurationManager.dll
System.Configuration.dll
System.Console.dll
System.Core.dll
System.Data.Common.dll
System.Data.DataSetExtensions.dll
System.Data.dll
System.Data.Odbc.dll
System.Data.OleDb.dll
System.Data.SqlClient.dll
System.Design.dll
System.Diagnostics.Contracts.dll
System.Diagnostics.Debug.dll
System.Diagnostics.DiagnosticSource.dll
System.Diagnostics.EventLog.dll
System.Diagnostics.EventLog.Messages.dll
System.Diagnostics.FileVersionInfo.dll
System.Diagnostics.PerformanceCounter.dll
System.Diagnostics.Process.dll
System.Diagnostics.StackTrace.dll
System.Diagnostics.TextWriterTraceListener.dll
System.Diagnostics.Tools.dll
System.Diagnostics.TraceSource.dll
System.Diagnostics.Tracing.dll
System.DirectoryServices.AccountManagement.dll
System.DirectoryServices.dll
System.DirectoryServices.Protocols.dll
System.dll
System.Drawing.Common.dll
System.Drawing.Design.dll
System.Drawing.dll
System.Drawing.Primitives.dll
System.Dynamic.Runtime.dll
System.Formats.Asn1.dll
System.Globalization.Calendars.dll
System.Globalization.dll
System.Globalization.Extensions.dll
System.IO.Compression.Brotli.dll
System.IO.Compression.dll
System.IO.Compression.FileSystem.dll
System.IO.Compression.ZipFile.dll
System.IO.dll
System.IO.FileSystem.AccessControl.dll
System.IO.FileSystem.dll
System.IO.FileSystem.DriveInfo.dll
System.IO.FileSystem.Primitives.dll
System.IO.FileSystem.Watcher.dll
System.IO.IsolatedStorage.dll
System.IO.MemoryMappedFiles.dll
System.IO.Packaging.dll
System.IO.Pipes.AccessControl.dll
System.IO.Pipes.dll
System.IO.Ports.dll
System.IO.UnmanagedMemoryStream.dll
System.Linq.dll
System.Linq.Expressions.dll
System.Linq.Parallel.dll
System.Linq.Queryable.dll
System.Management.Automation.dll
System.Management.dll
System.Memory.dll
System.Net.dll
System.Net.Http.dll
System.Net.Http.Json.dll
System.Net.Http.WinHttpHandler.dll
System.Net.HttpListener.dll
System.Net.Mail.dll
System.Net.NameResolution.dll
System.Net.NetworkInformation.dll
System.Net.Ping.dll
System.Net.Primitives.dll
System.Net.Requests.dll
System.Net.Security.dll
System.Net.ServicePoint.dll
System.Net.Sockets.dll
System.Net.WebClient.dll
System.Net.WebHeaderCollection.dll
System.Net.WebProxy.dll
System.Net.WebSockets.Client.dll
System.Net.WebSockets.dll
System.Numerics.dll
System.Numerics.Vectors.dll
System.ObjectModel.dll
System.Printing.dll
System.Private.CoreLib.dll
System.Private.DataContractSerialization.dll
System.Private.ServiceModel.dll
System.Private.Uri.dll
System.Private.Xml.dll
System.Private.Xml.Linq.dll
System.Reflection.Context.dll
System.Reflection.DispatchProxy.dll
System.Reflection.dll
System.Reflection.Emit.dll
System.Reflection.Emit.ILGeneration.dll
System.Reflection.Emit.Lightweight.dll
System.Reflection.Extensions.dll
System.Reflection.Metadata.dll
System.Reflection.Primitives.dll
System.Reflection.TypeExtensions.dll
System.Resources.Extensions.dll
System.Resources.Reader.dll
System.Resources.ResourceManager.dll
System.Resources.Writer.dll
System.Runtime.Caching.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Runtime.CompilerServices.VisualC.dll
System.Runtime.dll
System.Runtime.Extensions.dll
System.Runtime.Handles.dll
System.Runtime.InteropServices.dll
System.Runtime.InteropServices.RuntimeInformation.dll
System.Runtime.Intrinsics.dll
System.Runtime.Loader.dll
System.Runtime.Numerics.dll
System.Runtime.Serialization.dll
System.Runtime.Serialization.Formatters.dll
System.Runtime.Serialization.Json.dll
System.Runtime.Serialization.Primitives.dll
System.Runtime.Serialization.Xml.dll
System.Security.AccessControl.dll
System.Security.Claims.dll
System.Security.Cryptography.Algorithms.dll
System.Security.Cryptography.Cng.dll
System.Security.Cryptography.Csp.dll
System.Security.Cryptography.Encoding.dll
System.Security.Cryptography.OpenSsl.dll
System.Security.Cryptography.Pkcs.dll
System.Security.Cryptography.Primitives.dll
System.Security.Cryptography.ProtectedData.dll
System.Security.Cryptography.X509Certificates.dll
System.Security.Cryptography.Xml.dll
System.Security.dll
System.Security.Permissions.dll
System.Security.Principal.dll
System.Security.Principal.Windows.dll
System.Security.SecureString.dll
System.ServiceModel.dll
System.ServiceModel.Duplex.dll
System.ServiceModel.Http.dll
System.ServiceModel.NetTcp.dll
System.ServiceModel.Primitives.dll
System.ServiceModel.Security.dll
System.ServiceModel.Syndication.dll
System.ServiceModel.Web.dll
System.ServiceProcess.dll
System.ServiceProcess.ServiceController.dll
System.Text.Encoding.CodePages.dll
System.Text.Encoding.dll
System.Text.Encoding.Extensions.dll
System.Text.Encodings.Web.dll
System.Text.Json.dll
System.Text.RegularExpressions.dll
System.Threading.AccessControl.dll
System.Threading.Channels.dll
System.Threading.dll
System.Threading.Overlapped.dll
System.Threading.Tasks.Dataflow.dll
System.Threading.Tasks.dll
System.Threading.Tasks.Extensions.dll
System.Threading.Tasks.Parallel.dll
System.Threading.Thread.dll
System.Threading.ThreadPool.dll
System.Threading.Timer.dll
System.Transactions.dll
System.Transactions.Local.dll
System.ValueTuple.dll
System.Web.dll
System.Web.HttpUtility.dll
System.Windows.Controls.Ribbon.dll
System.Windows.dll
System.Windows.Extensions.dll
System.Windows.Forms.Design.dll
System.Windows.Forms.Design.Editors.dll
System.Windows.Forms.dll
System.Windows.Forms.Primitives.dll
System.Windows.Input.Manipulations.dll
System.Windows.Presentation.dll
System.Xaml.dll
System.Xml.dll
System.Xml.Linq.dll
System.Xml.ReaderWriter.dll
System.Xml.Serialization.dll
System.Xml.XDocument.dll
System.Xml.XmlDocument.dll
System.Xml.XmlSerializer.dll
System.Xml.XPath.dll
System.Xml.XPath.XDocument.dll
tr
ucrtbase.dll
UIAutomationClient.dll
UIAutomationClientSideProviders.dll
UIAutomationProvider.dll
UIAutomationTypes.dll
vcruntime140_cor3.dll
WindowsBase.dll
WindowsFormsIntegration.dll
wpfgfx_cor3.dll
xx.txt
zh-Hans
zh-Hant
cs\Microsoft.CodeAnalysis.CSharp.resources.dll
cs\Microsoft.CodeAnalysis.resources.dll
cs\Microsoft.VisualBasic.Forms.resources.dll
cs\PresentationCore.resources.dll
cs\PresentationFramework.resources.dll
cs\PresentationUI.resources.dll
cs\ReachFramework.resources.dll
cs\System.Windows.Controls.Ribbon.resources.dll
cs\System.Windows.Forms.Design.resources.dll
cs\System.Windows.Forms.Primitives.resources.dll
cs\System.Windows.Forms.resources.dll
cs\System.Windows.Input.Manipulations.resources.dll
cs\System.Xaml.resources.dll
cs\UIAutomationClient.resources.dll
cs\UIAutomationClientSideProviders.resources.dll
cs\UIAutomationProvider.resources.dll
cs\UIAutomationTypes.resources.dll
cs\WindowsBase.resources.dll
cs\WindowsFormsIntegration.resources.dll
de\Microsoft.CodeAnalysis.CSharp.resources.dll
de\Microsoft.CodeAnalysis.resources.dll
de\Microsoft.VisualBasic.Forms.resources.dll
de\PresentationCore.resources.dll
de\PresentationFramework.resources.dll
de\PresentationUI.resources.dll
de\ReachFramework.resources.dll
de\System.Windows.Controls.Ribbon.resources.dll
de\System.Windows.Forms.Design.resources.dll
de\System.Windows.Forms.Primitives.resources.dll
de\System.Windows.Forms.resources.dll
de\System.Windows.Input.Manipulations.resources.dll
de\System.Xaml.resources.dll
de\UIAutomationClient.resources.dll
de\UIAutomationClientSideProviders.resources.dll
de\UIAutomationProvider.resources.dll
de\UIAutomationTypes.resources.dll
de\WindowsBase.resources.dll
de\WindowsFormsIntegration.resources.dll
es\Microsoft.CodeAnalysis.CSharp.resources.dll
es\Microsoft.CodeAnalysis.resources.dll
es\Microsoft.VisualBasic.Forms.resources.dll
es\PresentationCore.resources.dll
es\PresentationFramework.resources.dll
es\PresentationUI.resources.dll
es\ReachFramework.resources.dll
es\System.Windows.Controls.Ribbon.resources.dll
es\System.Windows.Forms.Design.resources.dll
es\System.Windows.Forms.Primitives.resources.dll
es\System.Windows.Forms.resources.dll
es\System.Windows.Input.Manipulations.resources.dll
es\System.Xaml.resources.dll
es\UIAutomationClient.resources.dll
es\UIAutomationClientSideProviders.resources.dll
es\UIAutomationProvider.resources.dll
es\UIAutomationTypes.resources.dll
es\WindowsBase.resources.dll
es\WindowsFormsIntegration.resources.dll
fr\Microsoft.CodeAnalysis.CSharp.resources.dll
fr\Microsoft.CodeAnalysis.resources.dll
fr\Microsoft.VisualBasic.Forms.resources.dll
fr\PresentationCore.resources.dll
fr\PresentationFramework.resources.dll
fr\PresentationUI.resources.dll
fr\ReachFramework.resources.dll
fr\System.Windows.Controls.Ribbon.resources.dll
fr\System.Windows.Forms.Design.resources.dll
fr\System.Windows.Forms.Primitives.resources.dll
fr\System.Windows.Forms.resources.dll
fr\System.Windows.Input.Manipulations.resources.dll
fr\System.Xaml.resources.dll
fr\UIAutomationClient.resources.dll
fr\UIAutomationClientSideProviders.resources.dll
fr\UIAutomationProvider.resources.dll
fr\UIAutomationTypes.resources.dll
fr\WindowsBase.resources.dll
fr\WindowsFormsIntegration.resources.dll
it\Microsoft.CodeAnalysis.CSharp.resources.dll
it\Microsoft.CodeAnalysis.resources.dll
it\Microsoft.VisualBasic.Forms.resources.dll
it\PresentationCore.resources.dll
it\PresentationFramework.resources.dll
it\PresentationUI.resources.dll
it\ReachFramework.resources.dll
it\System.Windows.Controls.Ribbon.resources.dll
it\System.Windows.Forms.Design.resources.dll
it\System.Windows.Forms.Primitives.resources.dll
it\System.Windows.Forms.resources.dll
it\System.Windows.Input.Manipulations.resources.dll
it\System.Xaml.resources.dll
it\UIAutomationClient.resources.dll
it\UIAutomationClientSideProviders.resources.dll
it\UIAutomationProvider.resources.dll
it\UIAutomationTypes.resources.dll
it\WindowsBase.resources.dll
it\WindowsFormsIntegration.resources.dll
ja\Microsoft.CodeAnalysis.CSharp.resources.dll
ja\Microsoft.CodeAnalysis.resources.dll
ja\Microsoft.VisualBasic.Forms.resources.dll
ja\PresentationCore.resources.dll
ja\PresentationFramework.resources.dll
ja\PresentationUI.resources.dll
ja\ReachFramework.resources.dll
ja\System.Windows.Controls.Ribbon.resources.dll
ja\System.Windows.Forms.Design.resources.dll
ja\System.Windows.Forms.Primitives.resources.dll
ja\System.Windows.Forms.resources.dll
ja\System.Windows.Input.Manipulations.resources.dll
ja\System.Xaml.resources.dll
ja\UIAutomationClient.resources.dll
ja\UIAutomationClientSideProviders.resources.dll
ja\UIAutomationProvider.resources.dll
ja\UIAutomationTypes.resources.dll
ja\WindowsBase.resources.dll
ja\WindowsFormsIntegration.resources.dll
ko\Microsoft.CodeAnalysis.CSharp.resources.dll
ko\Microsoft.CodeAnalysis.resources.dll
ko\Microsoft.VisualBasic.Forms.resources.dll
ko\PresentationCore.resources.dll
ko\PresentationFramework.resources.dll
ko\PresentationUI.resources.dll
ko\ReachFramework.resources.dll
ko\System.Windows.Controls.Ribbon.resources.dll
ko\System.Windows.Forms.Design.resources.dll
ko\System.Windows.Forms.Primitives.resources.dll
ko\System.Windows.Forms.resources.dll
ko\System.Windows.Input.Manipulations.resources.dll
ko\System.Xaml.resources.dll
ko\UIAutomationClient.resources.dll
ko\UIAutomationClientSideProviders.resources.dll
ko\UIAutomationProvider.resources.dll
ko\UIAutomationTypes.resources.dll
ko\WindowsBase.resources.dll
ko\WindowsFormsIntegration.resources.dll
pl\Microsoft.CodeAnalysis.CSharp.resources.dll
pl\Microsoft.CodeAnalysis.resources.dll
pl\Microsoft.VisualBasic.Forms.resources.dll
pl\PresentationCore.resources.dll
pl\PresentationFramework.resources.dll
pl\PresentationUI.resources.dll
pl\ReachFramework.resources.dll
pl\System.Windows.Controls.Ribbon.resources.dll
pl\System.Windows.Forms.Design.resources.dll
pl\System.Windows.Forms.Primitives.resources.dll
pl\System.Windows.Forms.resources.dll
pl\System.Windows.Input.Manipulations.resources.dll
pl\System.Xaml.resources.dll
pl\UIAutomationClient.resources.dll
pl\UIAutomationClientSideProviders.resources.dll
pl\UIAutomationProvider.resources.dll
pl\UIAutomationTypes.resources.dll
pl\WindowsBase.resources.dll
pl\WindowsFormsIntegration.resources.dll
pt-BR\Microsoft.CodeAnalysis.CSharp.resources.dll
pt-BR\Microsoft.CodeAnalysis.resources.dll
pt-BR\Microsoft.VisualBasic.Forms.resources.dll
pt-BR\PresentationCore.resources.dll
pt-BR\PresentationFramework.resources.dll
pt-BR\PresentationUI.resources.dll
pt-BR\ReachFramework.resources.dll
pt-BR\System.Windows.Controls.Ribbon.resources.dll
pt-BR\System.Windows.Forms.Design.resources.dll
pt-BR\System.Windows.Forms.Primitives.resources.dll
pt-BR\System.Windows.Forms.resources.dll
pt-BR\System.Windows.Input.Manipulations.resources.dll
pt-BR\System.Xaml.resources.dll
pt-BR\UIAutomationClient.resources.dll
pt-BR\UIAutomationClientSideProviders.resources.dll
pt-BR\UIAutomationProvider.resources.dll
pt-BR\UIAutomationTypes.resources.dll
pt-BR\WindowsBase.resources.dll
pt-BR\WindowsFormsIntegration.resources.dll
ref\Microsoft.CSharp.dll
ref\Microsoft.VisualBasic.Core.dll
ref\Microsoft.VisualBasic.dll
ref\Microsoft.Win32.Primitives.dll
ref\mscorlib.dll
ref\netstandard.dll
ref\System.AppContext.dll
ref\System.Buffers.dll
ref\System.Collections.Concurrent.dll
ref\System.Collections.dll
ref\System.Collections.Immutable.dll
ref\System.Collections.NonGeneric.dll
ref\System.Collections.Specialized.dll
ref\System.ComponentModel.Annotations.dll
ref\System.ComponentModel.DataAnnotations.dll
ref\System.ComponentModel.dll
ref\System.ComponentModel.EventBasedAsync.dll
ref\System.ComponentModel.Primitives.dll
ref\System.ComponentModel.TypeConverter.dll
ref\System.Configuration.dll
ref\System.Console.dll
ref\System.Core.dll
ref\System.Data.Common.dll
ref\System.Data.DataSetExtensions.dll
ref\System.Data.dll
ref\System.Diagnostics.Contracts.dll
ref\System.Diagnostics.Debug.dll
ref\System.Diagnostics.DiagnosticSource.dll
ref\System.Diagnostics.FileVersionInfo.dll
ref\System.Diagnostics.Process.dll
ref\System.Diagnostics.StackTrace.dll
ref\System.Diagnostics.TextWriterTraceListener.dll
ref\System.Diagnostics.Tools.dll
ref\System.Diagnostics.TraceSource.dll
ref\System.Diagnostics.Tracing.dll
ref\System.dll
ref\System.Drawing.dll
ref\System.Drawing.Primitives.dll
ref\System.Dynamic.Runtime.dll
ref\System.Formats.Asn1.dll
ref\System.Globalization.Calendars.dll
ref\System.Globalization.dll
ref\System.Globalization.Extensions.dll
ref\System.IO.Compression.Brotli.dll
ref\System.IO.Compression.dll
ref\System.IO.Compression.FileSystem.dll
ref\System.IO.Compression.ZipFile.dll
ref\System.IO.dll
ref\System.IO.FileSystem.dll
ref\System.IO.FileSystem.DriveInfo.dll
ref\System.IO.FileSystem.Primitives.dll
ref\System.IO.FileSystem.Watcher.dll
ref\System.IO.IsolatedStorage.dll
ref\System.IO.MemoryMappedFiles.dll
ref\System.IO.Pipes.dll
ref\System.IO.UnmanagedMemoryStream.dll
ref\System.Linq.dll
ref\System.Linq.Expressions.dll
ref\System.Linq.Parallel.dll
ref\System.Linq.Queryable.dll
ref\System.Memory.dll
ref\System.Net.dll
ref\System.Net.Http.dll
ref\System.Net.Http.Json.dll
ref\System.Net.HttpListener.dll
ref\System.Net.Mail.dll
ref\System.Net.NameResolution.dll
ref\System.Net.NetworkInformation.dll
ref\System.Net.Ping.dll
ref\System.Net.Primitives.dll
ref\System.Net.Requests.dll
ref\System.Net.Security.dll
ref\System.Net.ServicePoint.dll
ref\System.Net.Sockets.dll
ref\System.Net.WebClient.dll
ref\System.Net.WebHeaderCollection.dll
ref\System.Net.WebProxy.dll
ref\System.Net.WebSockets.Client.dll
ref\System.Net.WebSockets.dll
ref\System.Numerics.dll
ref\System.Numerics.Vectors.dll
ref\System.ObjectModel.dll
ref\System.Reflection.DispatchProxy.dll
ref\System.Reflection.dll
ref\System.Reflection.Emit.dll
ref\System.Reflection.Emit.ILGeneration.dll
ref\System.Reflection.Emit.Lightweight.dll
ref\System.Reflection.Extensions.dll
ref\System.Reflection.Metadata.dll
ref\System.Reflection.Primitives.dll
ref\System.Reflection.TypeExtensions.dll
ref\System.Resources.Reader.dll
ref\System.Resources.ResourceManager.dll
ref\System.Resources.Writer.dll
ref\System.Runtime.CompilerServices.Unsafe.dll
ref\System.Runtime.CompilerServices.VisualC.dll
ref\System.Runtime.dll
ref\System.Runtime.Extensions.dll
ref\System.Runtime.Handles.dll
ref\System.Runtime.InteropServices.dll
ref\System.Runtime.InteropServices.RuntimeInformation.dll
ref\System.Runtime.Intrinsics.dll
ref\System.Runtime.Loader.dll
ref\System.Runtime.Numerics.dll
ref\System.Runtime.Serialization.dll
ref\System.Runtime.Serialization.Formatters.dll
ref\System.Runtime.Serialization.Json.dll
ref\System.Runtime.Serialization.Primitives.dll
ref\System.Runtime.Serialization.Xml.dll
ref\System.Security.Claims.dll
ref\System.Security.Cryptography.Algorithms.dll
ref\System.Security.Cryptography.Csp.dll
ref\System.Security.Cryptography.Encoding.dll
ref\System.Security.Cryptography.Primitives.dll
ref\System.Security.Cryptography.X509Certificates.dll
ref\System.Security.dll
ref\System.Security.Principal.dll
ref\System.Security.SecureString.dll
ref\System.ServiceModel.Web.dll
ref\System.ServiceProcess.dll
ref\System.Text.Encoding.CodePages.dll
ref\System.Text.Encoding.dll
ref\System.Text.Encoding.Extensions.dll
ref\System.Text.Json.dll
ref\System.Text.RegularExpressions.dll
ref\System.Threading.Channels.dll
ref\System.Threading.dll
ref\System.Threading.Overlapped.dll
ref\System.Threading.Tasks.Dataflow.dll
ref\System.Threading.Tasks.dll
ref\System.Threading.Tasks.Extensions.dll
ref\System.Threading.Tasks.Parallel.dll
ref\System.Threading.Thread.dll
ref\System.Threading.ThreadPool.dll
ref\System.Threading.Timer.dll
ref\System.Transactions.dll
ref\System.Transactions.Local.dll
ref\System.ValueTuple.dll
ref\System.Web.dll
ref\System.Web.HttpUtility.dll
ref\System.Windows.dll
ref\System.Xml.dll
ref\System.Xml.Linq.dll
ref\System.Xml.ReaderWriter.dll
ref\System.Xml.Serialization.dll
ref\System.Xml.XDocument.dll
ref\System.Xml.XmlDocument.dll
ref\System.Xml.XmlSerializer.dll
ref\System.Xml.XPath.dll
ref\System.Xml.XPath.XDocument.dll
ref\WindowsBase.dll
ru\Microsoft.CodeAnalysis.CSharp.resources.dll
ru\Microsoft.CodeAnalysis.resources.dll
ru\Microsoft.VisualBasic.Forms.resources.dll
ru\PresentationCore.resources.dll
ru\PresentationFramework.resources.dll
ru\PresentationUI.resources.dll
ru\ReachFramework.resources.dll
ru\System.Windows.Controls.Ribbon.resources.dll
ru\System.Windows.Forms.Design.resources.dll
ru\System.Windows.Forms.Primitives.resources.dll
ru\System.Windows.Forms.resources.dll
ru\System.Windows.Input.Manipulations.resources.dll
ru\System.Xaml.resources.dll
ru\UIAutomationClient.resources.dll
ru\UIAutomationClientSideProviders.resources.dll
ru\UIAutomationProvider.resources.dll
ru\UIAutomationTypes.resources.dll
ru\WindowsBase.resources.dll
ru\WindowsFormsIntegration.resources.dll
runtimes\unix
runtimes\win
runtimes\unix\lib
runtimes\unix\lib\net5.0
runtimes\unix\lib\net5.0\Modules
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Host
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Management
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Security
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Utility
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Host\Microsoft.PowerShell.Host.psd1
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1
runtimes\unix\lib\net5.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1
runtimes\win\lib
runtimes\win\lib\net5.0
runtimes\win\lib\net5.0\Modules
runtimes\win\lib\net5.0\Modules\CimCmdlets
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Diagnostics
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Host
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Management
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Security
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Utility
runtimes\win\lib\net5.0\Modules\Microsoft.WSMan.Management
runtimes\win\lib\net5.0\Modules\PSDiagnostics
runtimes\win\lib\net5.0\Modules\CimCmdlets\CimCmdlets.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Diagnostics\Diagnostics.format.ps1xml
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Diagnostics\Event.format.ps1xml
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Diagnostics\GetEvent.types.ps1xml
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Diagnostics\Microsoft.PowerShell.Diagnostics.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Host\Microsoft.PowerShell.Host.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.WSMan.Management\Microsoft.WSMan.Management.psd1
runtimes\win\lib\net5.0\Modules\Microsoft.WSMan.Management\WSMan.format.ps1xml
runtimes\win\lib\net5.0\Modules\PSDiagnostics\PSDiagnostics.psd1
runtimes\win\lib\net5.0\Modules\PSDiagnostics\PSDiagnostics.psm1
tr\Microsoft.CodeAnalysis.CSharp.resources.dll
tr\Microsoft.CodeAnalysis.resources.dll
tr\Microsoft.VisualBasic.Forms.resources.dll
tr\PresentationCore.resources.dll
tr\PresentationFramework.resources.dll
tr\PresentationUI.resources.dll
tr\ReachFramework.resources.dll
tr\System.Windows.Controls.Ribbon.resources.dll
tr\System.Windows.Forms.Design.resources.dll
tr\System.Windows.Forms.Primitives.resources.dll
tr\System.Windows.Forms.resources.dll
tr\System.Windows.Input.Manipulations.resources.dll
tr\System.Xaml.resources.dll
tr\UIAutomationClient.resources.dll
tr\UIAutomationClientSideProviders.resources.dll
tr\UIAutomationProvider.resources.dll
tr\UIAutomationTypes.resources.dll
tr\WindowsBase.resources.dll
tr\WindowsFormsIntegration.resources.dll
zh-Hans\Microsoft.CodeAnalysis.CSharp.resources.dll
zh-Hans\Microsoft.CodeAnalysis.resources.dll
zh-Hans\Microsoft.VisualBasic.Forms.resources.dll
zh-Hans\PresentationCore.resources.dll
zh-Hans\PresentationFramework.resources.dll
zh-Hans\PresentationUI.resources.dll
zh-Hans\ReachFramework.resources.dll
zh-Hans\System.Windows.Controls.Ribbon.resources.dll
zh-Hans\System.Windows.Forms.Design.resources.dll
zh-Hans\System.Windows.Forms.Primitives.resources.dll
zh-Hans\System.Windows.Forms.resources.dll
zh-Hans\System.Windows.Input.Manipulations.resources.dll
zh-Hans\System.Xaml.resources.dll
zh-Hans\UIAutomationClient.resources.dll
zh-Hans\UIAutomationClientSideProviders.resources.dll
zh-Hans\UIAutomationProvider.resources.dll
zh-Hans\UIAutomationTypes.resources.dll
zh-Hans\WindowsBase.resources.dll
zh-Hans\WindowsFormsIntegration.resources.dll
zh-Hant\Microsoft.CodeAnalysis.CSharp.resources.dll
zh-Hant\Microsoft.CodeAnalysis.resources.dll
zh-Hant\Microsoft.VisualBasic.Forms.resources.dll
zh-Hant\PresentationCore.resources.dll
zh-Hant\PresentationFramework.resources.dll
zh-Hant\PresentationUI.resources.dll
zh-Hant\ReachFramework.resources.dll
zh-Hant\System.Windows.Controls.Ribbon.resources.dll
zh-Hant\System.Windows.Forms.Design.resources.dll
zh-Hant\System.Windows.Forms.Primitives.resources.dll
zh-Hant\System.Windows.Forms.resources.dll
zh-Hant\System.Windows.Input.Manipulations.resources.dll
zh-Hant\System.Xaml.resources.dll
zh-Hant\UIAutomationClient.resources.dll
zh-Hant\UIAutomationClientSideProviders.resources.dll
zh-Hant\UIAutomationProvider.resources.dll
zh-Hant\UIAutomationTypes.resources.dll
zh-Hant\WindowsBase.resources.dll
zh-Hant\WindowsFormsIntegration.resources.dll

We are seeing strange behavior with the way scripts have been packaged for net5.0 and 7.1. We can’t use the built-in .NET single file executable so we are using a different tool.

what happens is when you run the script, the executable seems to complete but is still running in the background. After waiting for a little bit, it eventually outputs as expected. Looking into this issue still.

Thanks Adam.

My opinion is that you shouldn’t waste your time anymore with NET 5.0 and rather look into NET 6.0 and PWSH 7.2 now that both are officially available.

It’ll have a similar issue with 7.2 because of some issues with 7.1+ and .NET single executable packaging. I’ll get it sorted for both versions.

Do you have an ETA for this?

This is part of our December release cycle: PowerShell 7.2 Packaging ¡ Issue #683 ¡ ironmansoftware/issues ¡ GitHub

Adam, I just installed the December release and my results vary.

(1) Running merge-script from PWSH console or from VS Code give and error and EXE is not created.

Please, tell me why I am getting the message:

Failed to find the developer pack for .NET Version net60. Your build might fail. You can install the Developer Pack from Microsoft: .NET SDKs downloads for Visual Studio

for this, and why it does not appear when executed from Visual Studio 2022. Am I missing a Path?

(2) Creating the EXE using Visual Studio 2022 works (using Build)

The files created in the output folder are around 700. Are they all needed to run?

I was able to execute the resulting EXE (contains Windows Forms) without problem for the first time only. After I modified the script and recreated the EXE it runs, however does not display any form and just disappears. I haven’t been able to make it work again.

I can reproduce the above problems anytime.

Here are the same logs as in the images in case you need them.

Running merge-script:

PS C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys> merge-script -ConfigFile .\ManageSmartkeys-Core.psd1 -verbose
VERBOSE: Checking license
VERBOSE: OutputPath is C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\Core
VERBOSE: Bundling C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.ps1
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ListSmartkeys.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\DisplaySaving.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\APIfunctions.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.designer.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\ManageSmartkeys.resources.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\SmartkeyName.designer.ps1.
VERBOSE: Parsing file C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\SynchronizePEM.designer.ps1.
VERBOSE: Checking path $inFileName for XAML.
VERBOSE: Packaging C:\Users\Victor\AppData\Local\Temp\ManageSmartkeys.ps1
VERBOSE: Creating temp directory: C:\Users\Victor\AppData\Local\Temp\aa3f7c373b4043d9b9dc5112cbb2b2dd
VERBOSE: Packaging modules...
VERBOSE: Checking dotnet version.
VERBOSE: Checking dotnet SDK version.
VERBOSE: 6.0.101

VERBOSE: .NET SDK Version: 6.0.101

VERBOSE: Creating package project.
VERBOSE: Failed to find the developer pack for .NET Version net60. Your build might fail. You can install the Developer Pack from Microsoft: https://dotnet.microsoft.com/download/visual-studio-sdks
VERBOSE: Using .NET Framework version: net60
VERBOSE:   Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\aa3f7c373b4043d9b9dc5112cbb2b2dd\ManageSmartkeys.csproj (in 1.18 sec).

VERBOSE:   Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\aa3f7c373b4043d9b9dc5112cbb2b2dd\ManageSmartkeys.csproj (in 1.18 sec).

VERBOSE: Packaging C:\Users\Victor\AppData\Local\Temp\ManageSmartkeys.ps1 -> C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\Core\ManageSmartkeys.exe
VERBOSE: Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\aa3f7c373b4043d9b9dc5112cbb2b2dd\ManageSmartkeys.csproj (in 699 ms).
C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(140,5): error NETSDK1136: The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so. [C:\Users\Victor\AppData\Local\Temp\aa3f7c373b4043d9b9dc5112cbb2b2dd\ManageSmartkeys.csproj]

Merge-Script: Failed to build.
PS C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys>

Building from Visual Studio:

Build started...
------ Build started: Project: ManageSmartkeys, Configuration: Release Any CPU ------
		Checking license
		OutputPath is C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\bin\Release\
		Packaging ManageSmartkeys.ps1
		Creating temp directory: C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8
		Packaging modules...
		Checking dotnet version.
		Checking dotnet SDK version.
		6.0.101

		.NET SDK Version: 6.0.101

		Creating package project.
		Using .NET Framework version: net6.0
		  Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8\ManageKeysCore.csproj (in 700 ms).

		  Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8\ManageKeysCore.csproj (in 700 ms).

		Packaging ManageSmartkeys.ps1 -> C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\bin\Release\ManageKeysCore.exe
		Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8\ManageKeysCore.csproj (in 643 ms).
  ManageKeysCore -> C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8\bin\Release\net6.0-windows\win-x64\ManageKeysCore.dll
  ManageKeysCore -> C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\bin\Release\

		Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8\ManageKeysCore.csproj (in 643 ms).
  ManageKeysCore -> C:\Users\Victor\AppData\Local\Temp\7448f421983b4a49b7ce8465acd57ac8\bin\Release\net6.0-windows\win-x64\ManageKeysCore.dll
  ManageKeysCore -> C:\Users\Victor\Source\Repos\ManageSmartkeys\ManageSmartkeys\bin\Release\

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

What does your psd1 file look like for Merge-Script? It seems like you have ‘net60’ set as the .NET version rather than ‘net6.0’.

You only need the one exe. All the other files should be included within that exe. As for the file not updating, can you try to delete the \Release\ folder and try to rebuild and see if it has the same behavior?