- Powershell Core 6.2 Cookbook
- Jan Hendrik Peters
- 147字
- 2021-06-24 15:14:16
How to do it...
Let's perform the following steps:
- On Windows, run pwsh.exe. On Linux or macOS, run pwsh.
- Type your first cmdlet, Get-Process, to retrieve a list of running processes on the system and hit Enter to confirm.
- Compare the output of the cmdlet with the output of tasklist (in Windows) and ps (in Linux):

- Type Get-Date and hit Enter to confirm.
- Compare the output of this cmdlet with the output of date /t (in Windows) and date (in Linux):

- Execute the line: Get-Process | Where-Object -Property WorkingSet -gt 100MB.
- Compare the output again with the output of tasklist /FI "MEMUSAGE gt 102400" (in Windows) and ps -aux | awk -F" " '$5 > 102400' (in Linux):

- Lastly, execute this cmdlet: Stop-Computer -WhatIf. This time, there's no comparable command on either Windows or Linux.