Recall & Review
beginner
What is a PSSession in PowerShell?
A PSSession is a persistent connection to a remote computer that allows you to run commands and scripts on that computer as if you were working locally.
Click to reveal answer
beginner
How do you create a new PSSession to a remote computer named 'Server01'?
Use the command:
New-PSSession -ComputerName Server01 to create a new session to 'Server01'.Click to reveal answer
beginner
How can you list all active PSSessions in your current PowerShell session?
Use
Get-PSSession to see all active PSSessions you have open.Click to reveal answer
beginner
What command closes a specific PSSession stored in a variable $session?
Use
Remove-PSSession -Session $session to close and remove that session.Click to reveal answer
intermediate
Why is it useful to use PSSessions instead of running commands directly with Invoke-Command?
PSSessions keep the connection open, so you can run multiple commands efficiently without reconnecting each time. This saves time and resources.
Click to reveal answer
Which command creates a new persistent remote session in PowerShell?
✗ Incorrect
New-PSSession creates a new persistent remote session.
How do you see all your active remote sessions?
✗ Incorrect
Get-PSSession lists all active PSSessions.
What does Remove-PSSession do?
✗ Incorrect
Remove-PSSession closes and removes a session.
Why use PSSession over Invoke-Command for multiple commands?
✗ Incorrect
PSSession keeps the connection open, making multiple commands faster.
Which command runs a command inside an existing PSSession stored in $session?
✗ Incorrect
Invoke-Command with -Session runs commands inside an existing session.
Explain how to create, use, and close a PSSession in PowerShell.
Think about the lifecycle of a remote session.
You got /3 concepts.
Describe the benefits of using PSSession management for running multiple remote commands.
Consider time and resource savings.
You got /3 concepts.