#navi(../)
* PowerShellでサービス一覧を表示する・Get-Service [#s55b1567]
Get-Serviceコマンドレットを使用することにより、Windowsサービス一覧を表示することができます。~
以下にいくつかの使用例を紹介します。

#contents
#htmlinsertpcsp(win-top.html,win-sp.html)

** Get-Serviceコマンドレット使用例 [#i16a9009]
以下にいくつかGet-Serviceコマンドレットの実行例を記します。

** Get-Serviceコマンドレットを実行 [#gb895caf]
Get-Serviceコマンドレットを実行すると以下のように、Windowsサービス一覧が表示されます。
 PS D:\> Get-Service
 
 Status   Name               DisplayName
 ------   ----               -----------
 Stopped  AJRouter           AllJoyn Router Service
 Stopped  ALG                Application Layer Gateway Service
 Stopped  AppIDSvc           Application Identity
 Running  Appinfo            Application Information
 Stopped  AppReadiness       App Readiness
 Stopped  AppXSvc            AppX Deployment Service (AppXSVC)
 Running  AudioEndpointBu... Windows Audio Endpoint Builder
 Running  Audiosrv           Windows Audio
 Stopped  AxInstSV           ActiveX Installer (AxInstSV)
 Stopped  BcmBtRSupport      Bluetooth Driver Management Service
 Stopped  BDESVC             BitLocker Drive Encryption Service
 Running  BFE                Base Filtering Engine
 Running  BITS               Background Intelligent Transfer Ser...
 Running  BrokerInfrastru... Background Tasks Infrastructure Ser...
 Stopped  Browser            Computer Browser
 <省略>

** Runningのサービス一覧を表示 [#k3db24aa]
 PS D:\> Get-Service | Where-Object { $_.Status -eq "running" }
 
 Status   Name               DisplayName
 ------   ----               -----------
 Running  Appinfo            Application Information
 Running  AudioEndpointBu... Windows Audio Endpoint Builder
 Running  Audiosrv           Windows Audio
 Running  BFE                Base Filtering Engine
 Running  BITS               Background Intelligent Transfer Ser...
 Running  BrokerInfrastru... Background Tasks Infrastructure Ser...
 Running  BrYNSvc            BrYNSvc
 Running  bthserv            Bluetooth Support Service
 <省略>

 PS D:\> Get-Service | % { if ($_.Status -eq "running") { $_ } }
 
 Status   Name               DisplayName
 ------   ----               -----------
 Running  Appinfo            Application Information
 Running  AudioEndpointBu... Windows Audio Endpoint Builder
 Running  Audiosrv           Windows Audio
 Running  BFE                Base Filtering Engine
 Running  BITS               Background Intelligent Transfer Ser...
 Running  BrokerInfrastru... Background Tasks Infrastructure Ser...
 Running  BrYNSvc            BrYNSvc
 Running  bthserv            Bluetooth Support Service
 <省略>

** Stoppedのサービス一覧を表示 [#xe26f91d]
 PS D:\> Get-Service | Where-Object { $_.Status -eq "stopped" }
 
 Status   Name               DisplayName
 ------   ----               -----------
 Stopped  AJRouter           AllJoyn Router Service
 Stopped  ALG                Application Layer Gateway Service
 Stopped  AppIDSvc           Application Identity
 Stopped  AppReadiness       App Readiness
 Stopped  AppXSvc            AppX Deployment Service (AppXSVC)
 Stopped  AxInstSV           ActiveX Installer (AxInstSV)
 <省略>

 PS D:\> Get-Service | % { if ($_.Status -eq "stopped") { $_ } }
 
 Status   Name               DisplayName
 ------   ----               -----------
 Stopped  AJRouter           AllJoyn Router Service
 Stopped  ALG                Application Layer Gateway Service
 Stopped  AppIDSvc           Application Identity
 Stopped  AppReadiness       App Readiness
 Stopped  AppXSvc            AppX Deployment Service (AppXSVC)
 Stopped  AxInstSV           ActiveX Installer (AxInstSV)
 <省略>

以上、Windowsサービス一覧を表示するGet-Serviceコマンドレットの紹介でした。

#htmlinsertpcsp(win-btm.html,win-sp.html)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS