Forum Discussion
If you’re using the version from my github repo, you shouldn’t be setting the wildcard value. Instead, you should be setting the “Service_restart.services” property. What’s in the Exchange was submitted by Jake, an LMer who is no longer maintaining that module.
The wildvalue of each instance (what should be in that property) needs to be whatever is needed by the `Get-Service -Name $service -ComputerName $hostname` command. Apparently, that -Name parameter will take either the long name or the short name, so it should work either way.

Something to realize, this does not restart a service that is running. It only starts a service that is supposed to be running. If the service is already running when you do a poll now, it will return a result code of 1, meaning that it was already running.
Related Content
- 11 months ago
- 8 months ago