DEV Community


Posted on • Originally published at on

Quick Tip: Establishing PowerShell Remote Session – Docker Container

The title is quite self-explanatory, so, if you want to establish a remote session from PowerShell, running on your host, to the PowerShell, running on your container, just follow the next steps.

As the first step, we’ll need to get the Container ID, the necessary parameter to use on the cmdlet Enter-PSSession to perform the remote session.

docker ps –no-trunc

Afterward, we need to copy-paste the ID highlighted on the above image and perform the next step to end with the remote session established.

Enter-PSSession -ContainerId $ContainerID -RunAsAdministrator

And that’s it, remote session established… From this point on you’ll be able to run your cmdlets in your container from your host machine.

I hope that helped! Stay safe!

Discussion (0)