windows 我需要一个powershell脚本来获取服务状态沿着特定的显示名称和字段,如描述启动类型

tf7tbtn2  于 2023-03-19  发布在  Windows
关注(0)|答案(2)|浏览(124)

我需要一个PowerShell脚本来获取服务状态沿着特定的显示名称和字段,如描述启动类型。
Get-Service -DisplayName Windows* | Filter Description,DisplayName, Status,Name
Example of the Service Details Required

ldioqlga

ldioqlga1#

Get-Service -DisplayName Windows* | Select-Object -Property DisplayName, Status, Name, Description
d4so4syb

d4so4syb2#

也许这个脚本是有用的

$svcName = "SERVICENAME"
$svc = Get-Service $svcName

Write-Host "Name: " $svc.DisplayName
Write-Host "Status: " $svc.Status
Write-Host "Description: " $svc.Description
Write-Host "Start Type: " $svc.StartType

相关问题