PowerShell Service Template

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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
DavidSunter
Posts: 7
Joined: Wed Nov 19, 2014 7:13 am

PowerShell Service Template

Post by DavidSunter » Thu Apr 25, 2019 7:56 am

Product, version and build: PowerShell Studio 2019 5.6.161
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 1709 16299.1087
32 or 64 bit OS: 64 bit

I'm testing out the Service template, and simply taking the default template, adding a single Write-Host "Test" line within Startup.pss as such:

Code: Select all

if($global:bServicePaused -eq $false) #Only act if service is not paused
{
Write-Host "Test"
}
I then package the file using the PowerShell V5 Host (Windows Service) script engine
After packaging, I install the service via an elevated PowerShell window and can see the service via the Services console. The service starts successfully, however, nothing is ever written to the Application event log as expected.

I have searched this forum and found the following post from a year ago that had the same issue, although I'm not sure if a resolution was ever found:
viewtopic.php?f=12&t=12423

I have attached the demo project I have tested with if it helps.
Attachments
DemoServiceProject.zip
(140.02 KiB) Downloaded 24 times

User avatar
Olga_B
Site Admin
Posts: 112
Joined: Mon May 15, 2017 9:06 am

Re: PowerShell Service Template

Post by Olga_B » Wed May 01, 2019 11:10 am

The issue has been sent to the proper place for evaluation and correction.

User avatar
Olga_B
Site Admin
Posts: 112
Joined: Mon May 15, 2017 9:06 am

Re: PowerShell Service Template

Post by Olga_B » Thu May 02, 2019 2:41 pm

Please update the PowerShell Studio to the latest build 5.6.162, and let me know if it solve the problem