[PowerShell]Windows服务开启、重启、关闭

# 获取服务信息
PS C:\Users\Administrator> Get-Service win*

Status   Name               DisplayName
------   ----               -----------
Stopped  WinHttpAutoProx... WinHTTP Web Proxy Auto-Discovery Se...
Running  Winmgmt            Windows Management Instrumentation
Running  WinRM              Windows Remote Management (WS-Manag...
# 停止服务
PS C:\Users\Administrator> Stop-Service WinRM
PS C:\Users\Administrator> Get-Service WinRM

Status   Name               DisplayName
------   ----               -----------
Stopped  WinRM              Windows Remote Management (WS-Manag...
# 重启服务
PS C:\Users\Administrator> Restart-Service WinRM
PS C:\Users\Administrator> Get-Service WinRM

Status   Name               DisplayName
------   ----               -----------
Running  WinRM              Windows Remote Management (WS-Manag...

 

posted @ 2020-02-12 18:18  LeoShi2020  阅读(3974)  评论(0编辑  收藏  举报