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ā€™

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly