Skip to content

Instantly share code, notes, and snippets.

@b401
Last active May 17, 2022 06:26
Show Gist options
  • Save b401/e84779530efc09d819f1610cfbc898b3 to your computer and use it in GitHub Desktop.
Save b401/e84779530efc09d819f1610cfbc898b3 to your computer and use it in GitHub Desktop.
Enter-PSSession within powershell docker container

Pull docker image
docker pull mcr.microsoft.com/powershell:latest

Run container
docker run -it --rm mcr.microsoft.com/powershell:latest

Install WSMan-Module

Install-Module -Name PSWSMan
Import-Module PSWSMan
Install-WSMan

Connect to PSRemoting enabled system
Enter-PSSession -Computername {ip/host} -Credential domain\user -Authentication Negotiate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment