0
0
PowerShellscripting~10 mins

SSH-based remoting (PowerShell 7+) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start an SSH session to a remote computer named 'Server01'.

PowerShell
Enter-PSSession -HostName [1]
Drag options to blanks, or click blank then click option'
AServer01
Blocalhost
C192.168.1.1
DRemotePC
Attempts:
3 left
💡 Hint
Common Mistakes
Using the local computer name instead of the remote one.
Omitting the -HostName parameter.
2fill in blank
medium

Complete the code to run a command on a remote computer 'Server02' using SSH remoting.

PowerShell
Invoke-Command -HostName [1] -ScriptBlock { Get-Process }
Drag options to blanks, or click blank then click option'
ARemotePC
BServer02
CLocalHost
DMyComputer
Attempts:
3 left
💡 Hint
Common Mistakes
Using the local machine name instead of the remote one.
Forgetting to specify the -HostName parameter.
3fill in blank
hard

Fix the error in the code to properly create a new SSH session to 'Server03'.

PowerShell
$session = New-PSSession -HostName [1]
Drag options to blanks, or click blank then click option'
Aserver03
Bserver-03
CServer03
DSERVER03
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or altered hostname that might not resolve correctly.
Including invalid characters in the hostname.
4fill in blank
hard

Fill both blanks to create a new SSH session to 'Server04' and run a command to get the OS version.

PowerShell
$session = New-PSSession -HostName [1]
Invoke-Command -Session $session -ScriptBlock { [2] }
Drag options to blanks, or click blank then click option'
AServer04
BGet-CimInstance -ClassName Win32_OperatingSystem
CGet-Process
DServer05
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong hostname in the first blank.
Using a command unrelated to OS info in the second blank.
5fill in blank
hard

Fill all three blanks to create a session to 'Server05', run a command to list services, and then close the session.

PowerShell
$session = New-PSSession -HostName [1]
Invoke-Command -Session $session -ScriptBlock { [2] }
[3] -Session $session
Drag options to blanks, or click blank then click option'
AServer05
BGet-Service
CRemove-PSSession
DServer06
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong hostname or commands.
Forgetting to close the session.