回答編集履歴

1

追記

2018/12/10 14:39

投稿

nullpon
nullpon

スコア5737

test CHANGED
@@ -1,6 +1,38 @@
1
1
  むかし作ったやつです。こんな漢字で、
2
2
 
3
3
  ```Powershell
4
+
5
+ # プロセス一覧から実行中のプロセスを取得する。
6
+
7
+ # 入力 : プロセス一覧
8
+
9
+ # 返り値: 実行中のプロセス
10
+
11
+ function GetRunningProcess($processes) {
12
+
13
+ $runningProcess = @()
14
+
15
+ foreach ($serverProcess in @(Get-Process)) {
16
+
17
+ foreach ($process in $processes) {
18
+
19
+ if ($serverProcess.Id -eq $process.Id) {
20
+
21
+ $runningProcess += $serverProcess
22
+
23
+ }
24
+
25
+ }
26
+
27
+ }
28
+
29
+ ,$runningProcess
30
+
31
+ }
32
+
33
+
34
+
35
+
4
36
 
5
37
  # scripts: 実行するスクリプトのリスト
6
38