Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

get-process cmdlet in V2 CTP2

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 07-03-2008   #1 (permalink)
soulxflare
Guest


 

get-process cmdlet in V2 CTP2

I have been testing the CTP2 of Powershell and have noticed something
interesting. The cmdlets get-process and get-service now have a '-
ComputerName' parameter, but I can't get certain information using
that parameter. The function I wrote is:

function get-ProcessSnapshot( [string]$computer = "." ) {
Clear-Host
write-host $([datetime]::now)

$name = @{ label = "Process Name" ; expression = { $_.name } ; width
= 20 }
$id = @{ label = "PID" ; expression = { $_.id } }
$memory = @{ label = "Memory(MB)" ; expression = { $_.ws/1kb } ;
format = "{0:N0}" }
$cpu = @{ label = "CPU(Sec)" ; expression = { $_.cpu } ; format =
"{0:N}" }
$responding = @{ label = "Responding" ; expression =
{ $_.responding } }
$fields = $name,$id,$memory,$cpu,$responding
get-process -ComputerName $computer | sort ws -desc | format-table
$fields
}

I use this for taking periodic snapshots of various machines on our
domain. If I call it with no parameters, it has no issues populating
all of the fields for my computer. If I pass it the name of any other
computer (I have admin rights to all of these boxes), the $_.cpu and
$_.responding fields come up blank for every process in the list. Any
ideas as to why this behavior occurs? ... or if there is a better way
to get this information?

Thanks in advance.

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoking Cmdlet Get-Location from cmdlet,cant get Currnt Directory Vikram PowerShell 2 06-05-2008 04:41 AM
Re: CTP2: Remove-Module Cmdlet Bug Kiron PowerShell 1 05-15-2008 08:42 PM
Whether a cmdlet derives from cmdlet or pscmdlet Marco Shaw PowerShell 1 09-19-2007 09:18 PM
get-process cmdlet on Vista forestial PowerShell 6 02-25-2007 05:27 PM
Parameter names for a New-Process Cmdlet: item name and working directory Alex K. Angelopoulos [MVP] PowerShell 1 09-18-2006 12:59 PM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008