8

Is there a way to get the detailed "DESCRIPTION" of the Service? The below cmdlet can provide all of the properties of Windows Service including display name but it is not getting the "Description"

Get-Service | select -Property * | Out-GridView
M-A Charlotte
  • 325
  • 1
  • 3
  • 10

3 Answers3

7

Get-Service returns a limited set of information, go to Get-WmiObject win32_service for more:

Get-WmiObject win32_service | select * | ogv
mjsqu
  • 5,151
  • 1
  • 17
  • 21
  • Thanks, although apparently, it seems cmdlet for 32 bit Windows I tried that on 64 bit Windows and it worked there fine too! – M-A Charlotte Jan 13 '20 at 23:36
  • 1
    Good answer, but `Get-WmiObject` has been superseded by `Get-CimInstance` (and related commands) since Powershell v3. The commands function more or less identically, but `Get-WmiObject` was not developed after Powershell v3 and the command is not available at all on Powershell v6+. – Bacon Bits Mar 09 '21 at 13:13
4

Like say @mjsqu you can not do that with Get-Service, if you want just the description of your service, and print the result in the shell and not in a window, you can do that for ssh-agent for exemple:

NOT : Like say @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

If you want more informations you can run this command. But if you only want the description of the service launch the command above:

Get-WmiObject win32_service | ?{$_.Name -like 'ssh-agent'} | select Name, DisplayName, State, PathName, Description

And if you want this in a window with just the description

Get-WmiObject win32_service | select Description | ogv

But better with services name

Get-WmiObject win32_service | select Name,Description | ogv

and for specific service

Get-WmiObject win32_service | ?{$_.NAME -like 'ssh-agent'} | select Name,Description | ogv
LinkPhoenix
  • 385
  • 3
  • 7
3

In the standard Windows PowerShell (version <=5.1)

Get-WmiObject win32_service | select * | ogv

In the Core Powershell Core (version>6)

Get-CimInstance  win32_service | ?{$_.Name -like $name} | select Description

I also created a module which returns description for given service.

Get-ServiceDescription -name $servicename

To install module

Install-Module -Name ProductivityTools.GetServiceDescription 

enter image description here

Pawel Wujczyk
  • 422
  • 3
  • 12