Powershell 在远程计算机上监视进程时获取给定负值的进程命令

Powershell 在远程计算机上监视进程时获取给定负值的进程命令,powershell,Powershell,我正在我的系统上执行此命令 get-process $Processname -computername $Computername 但在输出中,它给了我负的工作集和分页内存大小值 输出: 请告诉我解决这个问题的方法。。 对于那些不明白我的意思的人,不需要在我解释更多的时候大声说出来。。 最初我是这样做的: if($env:Processor_Architecture -eq "x86") { write "`nrunning on 32bit" $a = @{Expression={$_.

我正在我的系统上执行此命令

get-process $Processname -computername $Computername 
但在输出中,它给了我负的工作集和分页内存大小值 输出:

请告诉我解决这个问题的方法。。 对于那些不明白我的意思的人,不需要在我解释更多的时候大声说出来。。 最初我是这样做的:

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
试试下面的方法--


应删除位检查,并且只应使用64位属性。旧的房产被废弃了

谢谢你的建议。但是我知道32位整数和64位整数之间的区别,我一开始也注意到了这一点,只是我在运行这个命令。这不是最清晰的注释。你说你“一开始就照顾好了”是什么意思?您是否更改了别名属性以引用64位版本的属性?也许你“最初处理相同的问题”的方式是导致负数的原因——你想分享吗?你能娱乐我,让我知道检索64位属性是否返回相同的负数吗?不,一点也不。如果是这样,那么我一定问了关于64位体系结构的问题,而不是关于远程系统的问题。。
get-process $Processname -computername $Computername  | format-table   $a -wrap
get-process $Processname -computername $Computername | ft Name,ID,VirtualMemorySize64,PeakVirtualMemorySize64,WorkingSet64,PeakWorkingSet64