After upgrading to Powershell 2019 it is not compiling to .exe correctly

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 3 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
matrixmike
Posts: 2
Last visit: Mon Feb 19, 2024 5:43 pm

After upgrading to Powershell 2019 it is not compiling to .exe correctly

Post by matrixmike »

Product, version and build: Powershell Studio 2019 version 5.6.156
Operating system: Windows 10 1909
PowerShell version(s): 5.1.18362.1171
32-bit version of software? x64


I have some code that compiled fine on Powershell Studio 2018 (version 5.5.155) however will not run on Powershell Studio 2019 (5.6.156). It runs fine if you run it within Powershell Studio, however, when you try to compile it to an .exe file it will not run. It compiles fine, but when you try to run the .exe It gives:

Line 5503: At line:5502 char:27
+ $buttonCustomize_Click = {
+ ~
Missing closing '}' in statement block or type definition.

At line:3072 char:1
+ {
+ ~
Missing closing '}' in statement block or type definition.

At line:5915 char:1
+ ))
+ ~
Unexpected token ')' in expression or statement.

At line:5915 char:2


+ ))
+ ~
Unexpected token ')' in expression or statement.

At line:7102 char:1
+ ))

and some more similar lines. I reinstalled PS 2018 and it ran fine, I upgraded to 2019 again and had the same issue.
User avatar
Alexander Riedel
Posts: 8472
Last visit: Mon Mar 18, 2024 2:59 pm
Answers: 19
Been upvoted: 37 times

Re: After upgrading to Powershell 2019 it is not compiling to .exe correctly

Post by Alexander Riedel »

Please zip and upload your project here: https://www.sapien.com/support/upload
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
matrixmike
Posts: 2
Last visit: Mon Feb 19, 2024 5:43 pm

Re: After upgrading to Powershell 2019 it is not compiling to .exe correctly

Post by matrixmike »

I don't believe I can, due to some of the content. Is there something that could be causing the compiler to handle it incorrectly because it runs fine from Powershell Studio? I saw some posts about UTF-8-BOM but I do not see anywhere to set that in this version.
User avatar
Alexander Riedel
Posts: 8472
Last visit: Mon Mar 18, 2024 2:59 pm
Answers: 19
Been upvoted: 37 times

Re: After upgrading to Powershell 2019 it is not compiling to .exe correctly

Post by Alexander Riedel »

Without looking at the generated code or the original project, that is impossible to determine.
Please note that the the 'packager' is not a 'compiler'. The packaged code is unmodified from the originally generated code.

If you are unable to upload the actual project, create a simple project with the same settings, no custom code other than what the problem areas indicate and see if that causes the same problem.
If so, send that to us please.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 3 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.