Examples using aliases Flashcards
1
Q
Get-Process p* | Stop-Process
or
ps p* | kill
A
Stop all processes that begin with the letter āpā
2
Q
Get-Process | Where-Obejct {$.ws -gt 1000MB} | Stop-Process
or
ps | ? {$.ws -gt 1000MB} | kill
A
Find the processes that use more than 1000 MB of memory and kill them.
3
Q
Get-ChildItem | Measure-Object -Property Length -Sum or ls | measure length -s or dir | measure length -s
A
Calculate the number of bytes in the files directory.
4
Q
$processToWatch = Get-Process Notepad
$processToWatch.Wait.ForExit()
or
(ps notepad).WaitForExit()
A
Determine whether a specific process is no longer running.
Wait for process to stop and then continue.