株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

基本中の基本な気がするけど、忘れてしまうので。

 
例えば実行中のサービスのみを抽出する場合

PS C:\Users\prtadmin01> Get-Service | Where-Object {$_.Status -match "^Running"}

Status   Name               DisplayName
------   ----               -----------
Running  AppHostSvc         Application Host Helper Service
Running  Appinfo            Application Information
Running  BFE                Base Filtering Engine
Running  BrokerInfrastru... Background Tasks Infrastructure Ser...
Running  CDPSvc             Connected Devices Platform Service
Running  CDPUserSvc_65899   CDPUserSvc_65899

 
さらにName列のみを抽出する場合

PS C:\Users\prtadmin01> Get-Service | Where-Object {$_.Status -match "^Running"} | Select-Object Name

Name
----
AppHostSvc
Appinfo
BFE
BrokerInfrastructure
CDPSvc
CDPUserSvc_65899

<スポンサーリンク>

4 Comments

4 Records

  1. on 2019年11月1日 at 2:29 PM
    774 wrote:

    ちょうど探していたpowershellコマンドでした!
    ありがとうございます。

    返信
    • on 2019年11月7日 at 8:52 PM
      yuta wrote:

      よかったです!

      返信
  2. on 2020年7月30日 at 6:08 PM
    るい wrote:

    ステキです。

    返信
    • on 2020年9月16日 at 11:45 AM
      yuta wrote:

      ありがとう!

      返信

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)