Windows 服务的 Powershell Get-Service 详细 "DESCRIPTION"
Powershell Get-Service detailed "DESCRIPTION" of the Windows Service
有没有办法得到服务的详细"DESCRIPTION"?下面的 cmdlet 可以提供 Windows 服务的所有属性,包括显示名称,但它没有获得 "Description"
Get-Service | select -Property * | Out-GridView
Get-Service returns 一组有限的信息,请转到 Get-WmiObject win32_service 获取更多信息:
Get-WmiObject win32_service | select * | ogv
就像说 @mjsqu 你不能用 Get-Service
那样做,如果你只想描述你的服务, 并在 shell 中打印结果而不是在 window 中,您可以为 ssh-agent
这样做,例如:
不是:就像说 @Bacon Bits if you are in PowerShell V3 is better if you do that commands with Get-CimInstance
more informations : here
Get-WmiObject win32_service | ?{$_.Name -like 'ssh-agent'} | select Description
如果您需要更多信息,可以运行此命令。但是,如果您只想要服务的描述,请启动上面的命令:
Get-WmiObject win32_service | ?{$_.Name -like 'ssh-agent'} | select Name, DisplayName, State, PathName, Description
如果您希望在 window 中仅包含描述
Get-WmiObject win32_service | select Description | ogv
但最好使用服务名称
Get-WmiObject win32_service | select Name,Description | ogv
和特定服务
Get-WmiObject win32_service | ?{$_.NAME -like 'ssh-agent'} | select Name,Description | ogv
有没有办法得到服务的详细"DESCRIPTION"?下面的 cmdlet 可以提供 Windows 服务的所有属性,包括显示名称,但它没有获得 "Description"
Get-Service | select -Property * | Out-GridView
Get-Service returns 一组有限的信息,请转到 Get-WmiObject win32_service 获取更多信息:
Get-WmiObject win32_service | select * | ogv
就像说 @mjsqu 你不能用 Get-Service
那样做,如果你只想描述你的服务, 并在 shell 中打印结果而不是在 window 中,您可以为 ssh-agent
这样做,例如:
不是:就像说 @Bacon Bits if you are in PowerShell V3 is better if you do that commands with Get-CimInstance
more informations : here
Get-WmiObject win32_service | ?{$_.Name -like 'ssh-agent'} | select Description
如果您需要更多信息,可以运行此命令。但是,如果您只想要服务的描述,请启动上面的命令:
Get-WmiObject win32_service | ?{$_.Name -like 'ssh-agent'} | select Name, DisplayName, State, PathName, Description
如果您希望在 window 中仅包含描述
Get-WmiObject win32_service | select Description | ogv
但最好使用服务名称
Get-WmiObject win32_service | select Name,Description | ogv
和特定服务
Get-WmiObject win32_service | ?{$_.NAME -like 'ssh-agent'} | select Name,Description | ogv