Deploying script as Windows Service broken in PowerShell Studio 2020

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 4 years and 1 month 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
abarker5
Posts: 3
Last visit: Mon Sep 18, 2023 8:13 am

Deploying script as Windows Service broken in PowerShell Studio 2020

Post by abarker5 »

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: PowerShell Studio 2020 5.7.172.0
32 or 64 bit version of product: 64
Operating system: Windows 10
32 or 64 bit OS: 64

*** Please add details and screenshots as needed below. ***
I recently upgraded from PowerShell Studio 2018 to 2020. I routinely build scripts and deploy them packaged as a Windows service. Since upgrading to 2020, the services do not work on Windows 7. If I deploy the same script from PowerShell Studio 2018 with the same settings, it works. If I run the script manually, it also works. It just won't work when packaged as a service using PowerShell Studio 2020. It works fine on a Windows 10 computer.




DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Attachments
2018Settings.png
2018Settings.png (48.67 KiB) Viewed 1955 times
2020Settings.png
2020Settings.png (19.96 KiB) Viewed 1955 times
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Deploying script as Windows Service broken in PowerShell Studio 2020

Post by brittneyr »

Can you please elaborate on how 'its not working'?
Does it not start? Does it crash? Are there any error messages?

Also, Windows 7 is no longer supported.
Brittney
SAPIEN Technologies, Inc.
User avatar
abarker5
Posts: 3
Last visit: Mon Sep 18, 2023 8:13 am

Re: Deploying script as Windows Service broken in PowerShell Studio 2020

Post by abarker5 »

The service runs, but does not do anything. It doesn't even write to the debug log I have set up. If I run the PowerShell script that is running inside the service, it works. Something is broken in the 2020 version, since I can use the 2018 version with no problems.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Deploying script as Windows Service broken in PowerShell Studio 2020

Post by Alexander Riedel »

Windows 7 is no longer supported, so it is not a platform we actually test on.
Since the service works on Windows 10 as you say, the problem is likely in your environment and not with the executable itself.
Please indicate:
- Which .NET frameworks are installed on the target machine
- Which PowerShell version is running on the target machine (please provide $psversiontable output)
- Is the .config file deployed alongside the executable.
- If the powershell code causes an error, or the service encounters a problem connecting to PowerShell, there would be
eventlog entries. Please look at the target systems application event log for any messages relating to the service.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 4 years and 1 month 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.