remote computer management in windows powershell

There are 2 ways to execute commands on Remote systems.
  • Invoke-Command
  • Enter-PSSession
Here is the example of Invoke-Command in Powershell. In below example, We are executing the command “Get-Process” on computer “C1”.
 
> Invoke-Command -Scriptblock {Get-Process} -ComputerName C1

Here is the syntax of “Enter-PSSession” command. Once you are connected to remote computer, you can execute commands on that system just like SSH.
 
> Enter-PSsession -ComputerName C1

To exit the session, you can use below command.
 
> Exit-PSsession

Web development and Automation testing

solutions delivered!!