Delete Scripts/Get-ProcessDescription.psm1

This commit is contained in:
Alex Kup 2024-02-06 15:14:45 +03:00 committed by GitHub
parent b709d7e96b
commit 31e13d4de1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,29 +0,0 @@
function Get-ProcessDescription {
param (
$ProcessName
)
if ($null -eq $ProcessName) {
$GetProcess = Get-Process -ErrorAction Ignore
}
else {
$GetProcess = Get-Process -Name $ProcessName -ErrorAction Ignore
}
if ($null -ne $GetProcess) {
$GetProcess | Sort-Object -Descending CPU | Select-Object ProcessName,
@{Name="TotalProcTime"; Expression={$_.TotalProcessorTime -replace "\.\d+$"}},
@{Name="UserProcTime"; Expression={$_.UserProcessorTime -replace "\.\d+$"}},
@{Name="PrivilegedProcTime"; Expression={$_.PrivilegedProcessorTime -replace "\.\d+$"}},
@{Name="WorkingSet"; Expression={[string]([int]($_.WS / 1024kb))+" MB"}},
@{Name="PeakWorkingSet"; Expression={[string]([int]($_.PeakWorkingSet / 1024kb))+" MB"}},
@{Name="PageMemory"; Expression={[string]([int]($_.PM / 1024kb))+" MB"}},
@{Name="VirtualMemory"; Expression={[string]([int]($_.VM / 1024kb))+" MB"}},
@{Name="PrivateMemory"; Expression={[string]([int]($_.PrivateMemorySize / 1024kb))+" MB"}},
@{Name="RunTime"; Expression={((Get-Date) - $_.StartTime) -replace "\.\d+$"}},
@{Name="Threads"; Expression={$_.Threads.Count}},
Handles,Path
}
}
# Get-ProcessDescription *
# Get-ProcessDescription *torrent*
# Get-ProcessDescription qbittorrent