Files
Sandbox/PSObject with Properties.ps1
Zack Meier 03dba08135 sync
2026-04-15 15:42:41 -05:00

47 lines
933 B
PowerShell

<#
.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
{
}
}