在远程计算机上监视进程时获取进程命令给出负值 [英] Get-process command giving negative value while monitoring process on a remote computer

查看:94
本文介绍了在远程计算机上监视进程时获取进程命令给出负值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的系统上执行这个命令

I am executing this command on my system

get-process $Processname -computername $Computername 

但在输出中它给了我负的工作集和分页内存大小值输出:

but in output its giving me negative Working set and Paged memory size value output:

Name        ID         VM   PeakVM          WS         PeakWS Thread     Handle
----        --         --   ------          --         ------ ------     ------
FusionA  10724      -1282     -988       -1777          -1697    232       2085
FusionA  10724      -1281     -988       -1746          -1697    232       2091
FusionA  10724      -1280     -988       -1713          -1697    232       2099
FusionA  10724      -1279     -988       -1707          -1697    232       2108
FusionA  10724      -1277     -988       -1702          -1697    232       2118

请让我知道解决这个问题的方法..对于那些不明白我的意思的人,无需在我解释更多时爆发.最初我正在做这样的事情:

Plz let me know the ways to comeover this issue.. For those who do not understand what I mean no need to to burst out plz as I am explaining it more.. Initially I am doing something like this:

if($env:Processor_Architecture -eq "x86")
{
write "`nrunning on 32bit"
$a = @{Expression={$_.Name.SubString(0,7)};Label="Name";width=7}, `
@{Expression={$_.ID};Label="ID";width=6}, `
@{Expression={$_.PagedMemorySize/1024};Label="VirtualMemory";width=10},
@{Expression={$_.PeakPagedMemorySize/1024};Label="PeakVirtualMemory";width=8},
@{Expression={$_.WS/1024};Label="WorkingSet";width=11},
@{Expression={$_.PeakWorkingSet/1024};Label="PeakWorkingSet";width=14},
@{Expression={$_.threads.count};Label="Threads";width=6},
@{Expression={$_.Handles};Label="Handles";width=10}

}
else
{
write "`nrunning on 64bit"
$a = @{Expression={$_.Name.SubString(0,7)};Label="Name";width=7}, `
@{Expression={$_.ID};Label="ID";width=6}, `
@{Expression={$_.PagedMemorySize64/1024};Label="VirtualMemory";width=10},
@{Expression={$_.PeakPagedMemorySize64/1024};Label="PeakVirtualMemory";width=10},
@{Expression={$_.WorkingSet64/1024};Label="WorkingSet";width=11},
@{Expression={$_.PeakWorkingSet64/1024};Label="PeakWorkingSet";width=14},
@{Expression={$_.threads.count};Label="Threads";width=6},
@{Expression={$_.Handles};Label="Handles";width=10}

}  

之后我运行以下命令:

get-process $Processname -computername $Computername  | format-table   $a -wrap

推荐答案

试试下面的 --

get-process $Processname -computername $Computername | ft Name,ID,VirtualMemorySize64,PeakVirtualMemorySize64,WorkingSet64,PeakWorkingSet64

您的位数检查应该被删除,您应该只使用 64 位属性.旧属性已过时.来源

Your bitness check should be removed and you should only used the 64-bit properties. The old properties are obselete. Source

这篇关于在远程计算机上监视进程时获取进程命令给出负值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆