Complete the code to create a new PowerShell session to a remote computer named 'Server01'.
$session = New-PSSession -ComputerName [1]The New-PSSession cmdlet creates a new session to the specified computer. Here, 'Server01' is the correct remote computer name.
Complete the code to enter an existing PSSession stored in the variable $session.
Enter-PSSession -[1] $sessionThe Enter-PSSession cmdlet uses the -Session parameter to specify the session object to enter.
Fix the error in the code to remove all PSSessions.
Get-PSSession | [1]-PSSessionThe correct cmdlet to remove sessions is Remove-PSSession. It deletes the sessions returned by Get-PSSession.
Fill both blanks to create a new PSSession to 'Server02' and store it in $sess.
$sess = [1] -ComputerName [2]
New-PSSession creates a new session, and the computer name must be 'Server02' as specified.
Fill all three blanks to filter PSSessions with state 'Opened' and remove them.
Get-PSSession | Where-Object { $_.State -eq '[1]' } | [2]-PSSession -[3]This code filters sessions with state 'Opened', removes them using Remove-PSSession, and uses the -Force parameter to ensure removal.