Any packaged exe will instantiate the currently installed PowerShell version. Generally, you should always package for the version installed on a system. As you can see from the error, the package does not actually work on a system that is not matching the packaged version. This is because .NET does not allow 'upscaling' versions, so assembly reference to lower versions cannot use a newer version of an assembly. That is inherent to .NET past the .NET framework Windows PowerShell uses.
Because that is an issue for deploying packages in environments that are not homogenous, we provide "PowerShell runtimes" which can be rolled to have a fixed version reference. A packaged executable will reference the assemblies of the matching runtime (if installed) rather than those of the installed PowerShell version.
Downloads for PowerShell 7 runtimes can be found here:
https://www.sapien.com/support/powershell_7_runtimes
Because that is an issue for deploying packages in environments that are not homogenous, we provide "PowerShell runtimes" which can be rolled to have a fixed version reference. A packaged executable will reference the assemblies of the matching runtime (if installed) rather than those of the installed PowerShell version.
Downloads for PowerShell 7 runtimes can be found here:
https://www.sapien.com/support/powershell_7_runtimes
Statistics: Posted by brittneyr — Thu Dec 12, 2024 8:02 am