New Form Project and AllSigned Execution Policy

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.
User avatar
FarmersDairy
Posts: 22
Joined: Wed May 02, 2012 7:35 am

New Form Project and AllSigned Execution Policy

Post by FarmersDairy »

OS: Windows 7 Professional (64-bit)
PSS: 2014 v4.1.48 (64-bit)

I was playing around with PSS2014 and I setup it up to automatically code sign on SAVE, with a self-signed certificate. I tried it with a few .ps1 scripts and all is well. When I created basic form and whet to RUN it I get the following error in the Output.

Code: Select all

>> Running (SAK.psproj) Project Script...
>> Platform: V4 64Bit (STA)
ERROR: & : File C:\Users\xxx\PowerShell Studio 2014\SAK\SAK.Run.ps1 cannot be loaded. The file
ERROR: C:\Users\xxx\PowerShell Studio 2014\SAK\SAK.Run.ps1 is not digitally signed. You cannot run this script on the
ERROR: current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
ERROR: http://go.microsoft.com/fwlink/?LinkID=135170.
line (1): ERROR: At Line: 1 char: 2
ERROR: + &'C:\Users\xxx\PowerShell Studio 2014 ...
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR:     + CategoryInfo          : SecurityError: (:) [], PSSecurityException
ERROR:     + FullyQualifiedErrorId : UnauthorizedAccess

>> Execution time: 00:00:01
>> Script Ended

The execution policy on my work computer is set to AllSigned. This is done in a GPO from Active Directory. As a test, I manually set the "localmachine" execution policy to "RemoteSigned" but it had no affect on running the form. I got the same error. I assume that during the creation process code signing of an exported .ps1 (SAK.Run.ps1) is not taking place?

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: New Form Project and AllSigned Execution Policy

Post by davidc »

Make sure you also checked the "Automatically sign exported scripts" option. Form files are handled slightly different then normal ps1 scripts.

David
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: New Form Project and AllSigned Execution Policy

Post by davidc »

The next service release will merge these settings.

David
David
SAPIEN Technologies, Inc.