WinRM Windows Docker image
Run Microsoft WinRM service in a Windows container.
Why?
You might want to have an integration test environment to try it out.
Build the image
docker build -t winrm:ltsc2022 .
Run the container
docker run -d --name winrm_server winrm:ltsc2022
or, if you want to expose WinRM ports:
docker run -d --name winrm_server -p 55985:5985 -p 55986:5986 winrm:ltsc2022
Connect to the container via WinRM
$IP = docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" winrm_server
$CRED = New-Object PSCredential 'User', (ConvertTo-SecureString -String 'Password12345!' -AsPlainText -Force)
Enter-PSSession -Credential $CRED -ComputerName $IP -Authentication Basic -UseSSL -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck)
Stop the container
docker rm --force winrm_server