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 2018 v5.5.154
32 or 64 bit version of product: 64 bit
Operating system: Woindows 10
32 or 64 bit OS: 64 bit
*** Please add details and screenshots as needed below. ***
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
i build the service.
if get some error, the service look is running but it is not work.
Service will be sluggish when scrpit encounters error
Forum rules
Do not post any licensing information in this forum.
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 any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- jason@sbtc.com.tw
- Posts: 26
- Last visit: Wed Jan 17, 2024 11:18 pm
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Service will be sluggish when scrpit encounters error
"i build the service.
if get some error, the service look is running but it is not work."
I am sorry, but that is not enough information to determine what your problem might be.
"i build the service": I am assuming that means you packaged a script as a service? If so, with what options? For what platform?
"Some error": What exactly does that mean?
"it is not work": That can mean anything from doing nothing over rebooting your computer to causing a blackout in Singapore. Can you be more specific?
Maybe you can explain what your service does and WHERE it counters an error.
if get some error, the service look is running but it is not work."
I am sorry, but that is not enough information to determine what your problem might be.
"i build the service": I am assuming that means you packaged a script as a service? If so, with what options? For what platform?
"Some error": What exactly does that mean?
"it is not work": That can mean anything from doing nothing over rebooting your computer to causing a blackout in Singapore. Can you be more specific?
Maybe you can explain what your service does and WHERE it counters an error.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- jason@sbtc.com.tw
- Posts: 26
- Last visit: Wed Jan 17, 2024 11:18 pm
Re: Service will be sluggish when scrpit encounters error
with what options? For what platform?
Script Engines:
Target : Microsoft Windows 64 bit.
SAPIEN Powershel V3 Host(windows Service)
"Some error": What exactly does that mean?
some file the name content @, example: 6X@CSKA[)JY5SJQ2(08-30-14-44-41).jpg
Example Code: $Filesarray = Get-ChildItem -path "$Workpath"
Remove-Item $Filesarray
it will to leader error, and the service will stop working but the service status is still in Running.
Will work normally after the service restarts.
Script Engines:
Target : Microsoft Windows 64 bit.
SAPIEN Powershel V3 Host(windows Service)
"Some error": What exactly does that mean?
some file the name content @, example: 6X@CSKA[)JY5SJQ2(08-30-14-44-41).jpg
Example Code: $Filesarray = Get-ChildItem -path "$Workpath"
Remove-Item $Filesarray
it will to leader error, and the service will stop working but the service status is still in Running.
Will work normally after the service restarts.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Service will be sluggish when scrpit encounters error
You need to catch errors inside your script and handle them accordingly.
It is imperative that your script does not exit until a stop service command is issued. It is your responsibility to handle any errors in your script.
Just because your script stopped or crashed does not make the outer service wrapper stop or change its status.
It is imperative that your script does not exit until a stop service command is issued. It is your responsibility to handle any errors in your script.
Just because your script stopped or crashed does not make the outer service wrapper stop or change its status.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- jason@sbtc.com.tw
- Posts: 26
- Last visit: Wed Jan 17, 2024 11:18 pm
Re: Service will be sluggish when scrpit encounters error
However, if it works as a script, the script will not stop.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Service will be sluggish when scrpit encounters error
A service runs under a different account. Usually defaulting to the system account. Files or folder may not be accessible to that account, drives not mapped, network shares not available etc.
Without any information it is impossible to tell.
Without any information it is impossible to tell.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- jason@sbtc.com.tw
- Posts: 26
- Last visit: Wed Jan 17, 2024 11:18 pm
Re: Service will be sluggish when scrpit encounters error
I used try and catch, the service still stopped working. if get error.
This is not a permission issue.
The working directory in the c:\ drive.
i know is 6X@CSKA[)JY5SJQ2(08-30-14-44-41).jpg file name to leader this problem.
i hope to know how to keep the service working.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Service will be sluggish when scrpit encounters error
[Moved to PowerShell forum by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- jason@sbtc.com.tw
- Posts: 26
- Last visit: Wed Jan 17, 2024 11:18 pm