How to execute package using PowerShell v4.0?

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 9 years and 4 months 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
lee.wilmott
Posts: 10
Last visit: Wed Jun 28, 2023 8:21 am

How to execute package using PowerShell v4.0?

Post by lee.wilmott »

I hope someone can help me.

I am using PowerShell Studio v4.1.74 (x64) with Windows 8.1 x64 Enterprise.

I have created a Windows Form and it works exactly how I expect - when executed through PowerShell Studio.

It contains a TextBox along with a ComboBox.

The Platform details (shown on the Ribbon's 'Home' tab) are as follows...

- Local Machine
- V4 - 64 Bit

However, when I create a '.exe' package the script does not work how I intend. I 'think' the 'SelectedIndexChanged' events aren't being triggered.

If I look at the "Packager Settings" then the Platform is set to "SAPIEN PowerShell V2 Host (Windows Forms) x64".

If I change the "Platform" settings on the Ribbon's 'Home' tab to "V2 - 64 Bit" then my script works in exactly the same way as my packaged script - ie. the SelectIndexChanged events aren't being triggered.

I suspect that the problem is that the Packager Settings do NOT have a "SAPIEN PowerShell V4 Host (Windows Forms) x64".

How do I configure the packager to execute using PowerShell v4?

Many thanks in advance,

Lee
Last edited by lee.wilmott on Mon Nov 17, 2014 4:29 am, edited 1 time in total.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How to execute package using PowerShell v4.0?

Post by davidc »

It is hard to say what is happening without seeing the script, but it sounds like a possible scoping issue. PowerShell's scoping behavior changed slightly from PowerShell v2 to v3.

David
David
SAPIEN Technologies, Inc.
User avatar
lee.wilmott
Posts: 10
Last visit: Wed Jun 28, 2023 8:21 am

Re: How to execute package using PowerShell v4.0?

Post by lee.wilmott »

Hi David,

Many thanks for reply.

I realise I haven't posted any code...I guess the point I'm trying to make is that the PowerShell Studio Packager Settings only allow you to select "PowerShell v2.0" or "PowerShell v3.0". I want to create an .exe package that uses PowerShell v4.0.

.

Kind regards,

Lee
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How to execute package using PowerShell v4.0?

Post by davidc »

The V3 engine will work with PowerShell V4 as well.

David
David
SAPIEN Technologies, Inc.
This topic is 9 years and 4 months 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.