Page 1 of 1

Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Sat May 16, 2020 2:40 pm
by ALIENQuake
To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build:
version of product: PowerShell Studio 5.7.177
Operating system:
64 bit OS:Microsoft Windows 10.0.19555

*** Please add details and screenshots as needed below. ***

- create empty Forms project, set Deploy>Build as PowerShell 7/Net Core 3.1
- compile to exe, bin output:

Code: Select all

Microsoft.ApplicationInsights.dll
Microsoft.PowerShell.CoreCLR.Eventing.dll
Newtonsoft.Json.dll
powershell.config.json
PowerShell.Core.Instrumentation.dll
PS7Net3.exe
pwrshplugin.dll
SAPIEN.PoshCoreHostWin.deps.json
SAPIEN.PoshCoreHostWin.dll
SAPIEN.PoshCoreHostWin.runtimeconfig.json
System.Management.Automation.dll
System.Management.dll
- run compiled exe, an error occurs:
Image

Code: Select all

---------------------------
PowerShell cannot be instantiated
---------------------------
Could not load file or assembly 'System.Management.Automation, Version=7.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)
---------------------------
OK   
---------------------------
uninstalling PowerShell 7.0.1 from the system and installing PowerShell 7.0.0 is a workaround for the problem.

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Mon May 18, 2020 7:41 am
by brittneyr
From looking at the PowerShell GitHub page, the latest build of PowerShell (7.0.1) also updated the .Net Core version required; this is what is causing the issue you are experiencing. We are looking further into this to see what we can do and I will update you when I have more information to share.

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Mon May 18, 2020 9:57 am
by ALIENQuake
Thanks! I hope that you see now why it's a good idea to have a self-contained deployment, even if the application folder will have 100+ dll's.

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Mon May 18, 2020 10:21 am
by Alexander Riedel
I remember you saying that before. I hope you can appreciate that not everyone agrees with your position on that. Secondly, and much more importantly, that doesn't help a darn thing.
The first thing I did this morning was to republish a packager engine as 'self contained' with the 100's of dll's you mention. It just results in the same error message.

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Fri May 29, 2020 5:50 am
by ALIENQuake
brittneyr Any news?

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Fri May 29, 2020 7:07 am
by brittneyr
Build 5.7.178 was released to work with 7.0.1, but will not work with 7.0.0. We are currently in the process of coming up with a solution so this is not an issue in the future.

Re: Installing PowerShell 7.0.1 break PS7/NetCore3.1 compiled scripts

Posted: Fri May 29, 2020 8:08 am
by ALIENQuake
Thanks for the info, looking forward to it.