From 085eadd929cda2964d54239422bb953d5e8da39f Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sun, 30 Apr 2017 17:51:51 +0200 Subject: [PATCH] Another test --- src/ci/scripts/cleanup.ps1 | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/ci/scripts/cleanup.ps1 b/src/ci/scripts/cleanup.ps1 index 6f32e9f03..01d60d1d7 100644 --- a/src/ci/scripts/cleanup.ps1 +++ b/src/ci/scripts/cleanup.ps1 @@ -2,7 +2,25 @@ Powershell script for cleaning up remaining processes on the CI servers #> -Get-Process +Get-Process | Get-Member +Get-Process | Select-Object name,fileversion,productversion,company + +$View = @( + @{l='Handles';e={$_.HandleCount}}, + @{l='NPM(K)';e={ (Get-Process -Id $_.ProcessId).NonpagedSystemMemorySize/1KB -as [int]}}, + @{l='PM(K)';e={ $_.PrivatePageCount/1KB -as [int]}}, + @{l='WS(K)';e={ $_.WorkingSetSize/1KB -as [int]}}, + @{l='VM(M)';e={ $_.VirtualSize/1mB -as [int]}}, + @{l='CPU(s)';e={ (Get-Process -Id $_.ProcessId).CPU -as [int]}}, + @{l='Id';e={ $_.ProcessId}}, + 'UserName' + @{l='ProcessName';e={ $_.ProcessName}} +) +Get-WmiObject Win32_Process | % { $_ | + Add-Member -MemberType ScriptProperty -Name UserName -Value { + '{0}\{1}' -f $this.GetOwner().Domain,$this.GetOwner().User + } -Force -PassThru +} $processes = Get-WmiObject Win32_Process -Filter "name = 'java.exe'" foreach($proc in $processes) @@ -16,6 +34,6 @@ foreach($proc in $processes) Write-Host "skipping proccess $($proc.ProcessId) with $($proc.ThreadCount) threads; $($proc.CommandLine.Substring(0, 50))..." } } -Get-Process firefox | Stop-Process -Get-Process chrome | Stop-Process -Get-Process iexplore | Stop-Process +Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process +Get-Process chrome -ErrorAction SilentlyContinue | Stop-Process +Get-Process iexplore -ErrorAction SilentlyContinue | Stop-Process -- 2.39.5