powershell
aliases
% = foreach = ForEach
? = where = Where-Object # ?{ $_ -NotMatch "regex" } Basic
Set-ExecutionPolicy RemoteSigned
Enable-PSRemoting -Force
Import-Module ServerManager
Add-WindowsFeature RDS-Virtualizationdisk
GWMI -namespace root\cimv2 -class win32_volume | FL -property DriveLetter, DeviceIDlist top processes sort by memory
Get-Process | Sort WorkingSet -Descending | select-object Id, Name,
@{Name='WorkingSet(Mb)';Expression={"{0:N2}" -f ($_.WorkingSet / 1Mb)}},
@{Name='PrivateMemorySize(Mb)';Expression={"{0:N2}" -f ($_.PrivateMemorySize / 1Mb)}},
@{Name='PM(Mb)';Expression={"{0:N2}" -f ($_. PM/ 1Mb)}},
@{Name='NPM(Mb)';Expression={"{0:N2}" -f ($_. NPM/ 1Mb)}} `
-First 10 | Format-Tablesum memory of all processes
Get-Process | measure-object -sum 'PrivateMemorySize', PM,NPM,WS |
select-object @{Name='Sum(Gb)';Expression={"{0:N2}" -f ($_.sum / 1Gb ) } } ,count, Propertylist and grep process members
Get-Process | Get-Member | findstr Memquery process by WMI
Get-WMIObject Win32_ProcessLast updated
Was this helpful?