So I am at a big roadblock right now. I was working in PowerShell 5.1 and had the Get-WmiObject
with the Win32_Service
Class working perfectly fine to remotely stop/start/restart services remotely. However, I found out that the .StopService()
method has been removed in PowerShell 6 (which I used this to bypass the dependencies issues I kept running in to). As well, I have found out that the -ComputerName
variable has also been removed from a lot of the different commandlets.
Since the removed the -ComputerName
from things like the Stop-Service
commandlet, I am struggling to figure out how to properly handle the stopping of the service itself. I can retrieve the service or services I want without issue. I just can't seem to figure out how to handle stopping the service.
Tried being as detailed as I can. I know I am missing something stupidly small, but all of my Google searches appear to return everything with PowerShell 5, but so little on 6.
Thanks.