다음을 통해 공유


Determining status of kernel driver with PowerShell

With PowerShell 2.0 on Windows Server 2008 R2 you can query a kernel-mode driver with the Get-Service cmdlet.

PS C:\ get-service http | fl *

Name                : HTTP
RequiredServices    : {}
CanPauseAndContinue : False
CanShutdown         : False
CanStop             : True
DisplayName         : http
DependentServices   : {WinRM, Wecsvc, W3SVC, upnphost...}
MachineName         : .
ServiceName         : HTTP
ServicesDependedOn  : {}
ServiceHandle       : SafeServiceHandle
Status              : Running
ServiceType         : KernelDriver
Site                :
Container           :

However with PowerShell 1.0 on Windows Server 2008, that same command does not work.

PS C:\ get-service http | fl *
Get-Service : Cannot find any service with service name 'http'.
At line:1 char:12

  • get-service  <<<< http

However you can use a .NET class instead, which works in PowerShell 1.0 and 2.0 on both Windows Server 2008 and Windows Server 2008 R2. Likely it works across all Windows versions that support at least PowerShell 1.0.

[System.ServiceProcess.ServiceController]::GetDevices() | where-object {$_.name -eq "http"} | fl *


Other Languages

This article is also available in other languages