32 or 64 bit version of product:64
Operating system: Win 10
32 or 64 bit OS: 64
*** Please add details and screenshots as needed below. ***
How can i react within the script to the Service Stop event?
Write-Host, Write-Error and Write-Warning and so on are transformed to Eventlog entries in the Application Log where the source is the Service Name. This i convinient, but i found a glitch.
The error is that thrown Errors are directed to the eventlog as separate entries. For example each of this lines is a separate Eventlog Line!
Code: Select all
+ Main ($CommandLine)
At line:102 char:1
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Main
<emtpy Line>