sync
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<#
|
||||
.Synopsis
|
||||
Short description
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
.EXAMPLE
|
||||
Example of how to use this cmdlet
|
||||
.EXAMPLE
|
||||
Another example of how to use this cmdlet
|
||||
#>
|
||||
function Get-PropertyObjectTest
|
||||
{
|
||||
[CmdletBinding()]
|
||||
Param
|
||||
(
|
||||
[string[]]
|
||||
$ProcessName
|
||||
)
|
||||
|
||||
Begin
|
||||
{
|
||||
}
|
||||
Process
|
||||
{
|
||||
$MyArrayList = [System.Collections.ArrayList]@()
|
||||
$null = $MyArrayList.Add($obj)
|
||||
ForEach ($Process in $ProcessName)
|
||||
{
|
||||
$Output = Get-Process -Name $Process
|
||||
|
||||
$obj=[PSCustomObject]@{
|
||||
'ProcessName' = $Output.Name;
|
||||
'CPU' = $Output.CPU -as [int];
|
||||
'VMGB' = $Output.VirtualMemorySize64 / 1GB -as [int];
|
||||
'WSMB' = $Output.WorkingSet64 / 1MB -as [int];
|
||||
}
|
||||
|
||||
#Write-Output $obj
|
||||
$null = $MyArrayList.Add($obj)
|
||||
}
|
||||
}
|
||||
End
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user