Complete the code to start an SSH session to a remote computer named 'Server01'.
Enter-PSSession -HostName [1]The Enter-PSSession cmdlet with the -HostName parameter starts an SSH session to the specified remote computer. Here, 'Server01' is the target host.
Complete the code to run a command on a remote computer 'Server02' using SSH remoting.
Invoke-Command -HostName [1] -ScriptBlock { Get-Process }-HostName parameter.The Invoke-Command cmdlet with -HostName runs the script block on the specified remote computer. 'Server02' is the target host here.
Fix the error in the code to properly create a new SSH session to 'Server03'.
$session = New-PSSession -HostName [1]PowerShell remoting over SSH is case-insensitive for hostnames, but best practice is to use the exact hostname as registered. 'Server03' matches the expected hostname format.
Fill both blanks to create a new SSH session to 'Server04' and run a command to get the OS version.
$session = New-PSSession -HostName [1] Invoke-Command -Session $session -ScriptBlock { [2] }
The first blank needs the remote hostname 'Server04' to create the session. The second blank runs the command to get the OS version using Get-CimInstance -ClassName Win32_OperatingSystem.
Fill all three blanks to create a session to 'Server05', run a command to list services, and then close the session.
$session = New-PSSession -HostName [1] Invoke-Command -Session $session -ScriptBlock { [2] } [3] -Session $session
First, create a session to 'Server05'. Then run Get-Service to list services. Finally, close the session with Remove-PSSession.