Page 1 of 1

PowerShell Service Template

Posted: Thu Apr 25, 2019 7:56 am
by DavidSunter
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.

Re: PowerShell Service Template

Posted: Wed May 01, 2019 11:10 am
by Olga_B
The issue has been sent to the proper place for evaluation and correction.

Re: PowerShell Service Template

Posted: Thu May 02, 2019 2:41 pm
by Olga_B
Please update the PowerShell Studio to the latest build 5.6.162, and let me know if it solve the problem