PoshCode Logo PowerShell Code Repository

Difference between
modified post 6808 by vinicius on Mon 20th Mar 23:43 and
original post 2413 by amirul on Sat 18th Dec 01:46
Showold version | new version | both versions

    
11
# use it as follows:
22
# PS C:\> ps explorer | trim
44
add-type -Namespace Win32 -Name Psapi -MemberDefinition @"
55
[DllImport("psapi", SetLastError=true)]
66
public static extern bool EmptyWorkingSet(IntPtr hProcess);
77
"@
99
filter Reset-WorkingSet {
1010
    [Win32.Psapi]::EmptyWorkingSet($_.Handle)
1111
}
1313
sal trim Reset-WorkingSet

ContributeMost Recent Contributions (feed)

Contribute ... Next Page