Home > Sample chapters > Programming > Visual Studio and .NET

Using PowerShell Remoting and Jobs

Chapter 4 quick reference

To

Do this

Work interactively on a remote system

Use the Enter-PSSession cmdlet to create a remote session.

Configure Windows PowerShell remoting

Use the Enable-PSRemoting function.

Run a command on a remote system

Use the Invoke-Command cmdlet and specify the command in a -scriptblock parameter.

Run a command as a job

Use the Start-Job cmdlet to execute the command.

Check on the progress of a job

Use the Get-Job cmdlet and specify either the job ID or the job name.

Check on the progress of the newest job

Use the Get-Job cmdlet and specify the -newest parameter, and supply the number of new jobs to monitor.

Retrieve the results from a job

Use the Receive-Job cmdlet and specify the job ID.