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.
User avatar
abarker5
Posts: 2
Joined: Sun Mar 03, 2013 12:45 pm

Deploying script as Windows Service broken in PowerShell Studio 2020

Post by abarker5 » Thu Feb 13, 2020 12:11 pm

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 316 times
2020Settings.png
2020Settings.png (19.96 KiB) Viewed 316 times

User avatar
brittneyr
Site Admin
Posts: 306
Joined: Thu Jun 01, 2017 7:20 am

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

Post by brittneyr » Thu Feb 13, 2020 12:35 pm

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 Ryn
SAPIEN Technologies, Inc.

User avatar
abarker5
Posts: 2
Joined: Sun Mar 03, 2013 12:45 pm

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

Post by abarker5 » Thu Feb 13, 2020 12:41 pm

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: 7210
Joined: Tue May 29, 2007 4:43 pm

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

Post by Alexander Riedel » Fri Feb 14, 2020 12:57 am

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.