Home > Sample chapters

Overview of Windows PowerShell 5.0

Chapter 1 quick reference

To

Do this

Use an external command-line utility

Enter the name of the command-line utility while inside Windows PowerShell.

Use multiple external command-line utilities sequentially

Separate each command-line utility with a semicolon on a single Windows PowerShell line.

Obtain a list of running processes

Use the Get-Process cmdlet.

Stop a process

Use the Stop-Process cmdlet and specify either the name or the process ID parameter.

Model the effect of a cmdlet before actually performing the requested action

Use the -WhatIf switch parameter.

Instruct Windows PowerShell to start up, run a cmdlet, and then exit

Use the PowerShell command while prefixing the cmdlet with & and enclosing the name of the cmdlet in braces.

Prompt for confirmation before stopping a process

Use the Stop-Process cmdlet while specifying the -Confirm parameter.