To help you better we need some information from you.
Product, version and build: SAPIEN PowerShell Studio 2019, Version 5.6.160
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 Enterprise 1709 OS Build 16299.1029
32 or 64 bit OS: 64 Bit
*** Please add details and screenshots as needed below. ***
When ever I save my script on PowerShell Studio it removes at last charactor in the script.
It seems to be related to the automatic signing of the script.
However it does not happen when I just select "Sign Script".
If I remove the setting to automatically sign the script on save, the error is gone.
Saving and sign script removes last charactor in script
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.
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.
- jessondergaard
- Posts: 2
- Last visit: Tue Jan 16, 2024 11:56 pm
Re: Saving and sign script removes last charactor in script
Is the file using Unix line ends?
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Saving and sign script removes last charactor in script
If you are using Unix line endings, the signing process unfortunately chops the last line because it expects and uses Windows line ends.
I will ask the Dev team to look into it, but since the signing process is external, I'm not sure there much we can do.
I will ask the Dev team to look into it, but since the signing process is external, I'm not sure there much we can do.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Saving and sign script removes last charactor in script
I confirmed this also occurs if you use the Set-AuthenticodeSignature cmdlet.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Saving and sign script removes last charactor in script
It's a bug in the WIndows API basically, it assumes that ALL files are CR/LF and acts accordingly. We will see what we can do as a workaround.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- jessondergaard
- Posts: 2
- Last visit: Tue Jan 16, 2024 11:56 pm
Re: Saving and sign script removes last charactor in script
I have now changed the file to use Windows CRLF line ends and then the problem is gone.
I was not aware of this, an actually not sure why the files was in Unix format. So this workaround is good enough for me.
Thank you for your quick help on this.
I was not aware of this, an actually not sure why the files was in Unix format. So this workaround is good enough for me.
Thank you for your quick help on this.
Re: Saving and sign script removes last charactor in script
We made some changes to hopefully work around the issue in case someone else uses Unix line endings.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Saving and sign script removes last charactor in script
We released the v5.6.161 service build that includes the work around.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.