我想使用Powershell获取正在运行的进程的磁盘Io和网络

时间:2018-06-26 22:11:44

标签: powershell

我正在运行我的Google云端硬盘进程,

我正在编写一种自动化工具,每5秒检查一次Google Drive进程的CPU,内存使用情况,磁盘IO和网络usgae,并将其写入文件中,

有人可以提供有关Power Shell命令的帮助吗,

我具有用于内存使用和CPU使用的Powershell脚本

内存使用-“获取进程” +“ GoogleDrive” +” |选择对象WS”

CPU使用率-$ processname = $ process.Name

        $samples = (Get-Counter “\Process($processname*)\% Processor Time”).CounterSamples
        $processcpu =  ($Samples | Select `InstanceName,@{Name=”CPU %”;Expression={[Decimal]::Round(($_.CookedValue / $CpuCores), 2)}}).'CPU %'

        $processpm = [math]::Round(($process.WS / 1000000),2)

请帮助我获取磁盘Io和网络IO的Powershell脚本

0 个答案:

没有答案