title: How to start PowerShell (x86) in Windows Docker Container?
body: <p>I am trying to start the PowerShell (x86) in Windows Docker Container from PowerShell but it won't start a new shell. I am running Docker from an AWS Windows EC2 running off the <code>Windows_Server-2019-English-Full-ContainersLatest-2020.02.12</code> AMI. Do I need any specific DLLs to make this work?</p>
  
  <p>I have Dockerfile which kind of looks like this:</p>
  
  <pre><code>FROM mcr.microsoft.com/windows/insider:10.0.17763.107
  ...
  SHELL ["PowerShell", "-Command"]
  ...
  CMD PowerShell
  </code></pre>
  
  <p>After the container start's up I try to start the 32-bit PowerShell using the below command but it doesn't start a new shell. I think it just errors out.</p>
  
  <pre><code>C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershell.exe
  </code></pre>
  
  <p>I tried to catch the ExitCode using the following commands:</p>
  
  <pre><code>$Process = Start-Process -PassThru -Wait -FilePath "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
  Write-Output "ExitCode = $($Process.ExitCode)"
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>ExitCode = -1073741502
  </code></pre>
  
  <p>Which probably means <code>STATUS_DLL_INIT_FAILED</code> (<a href="https://stackoverflow.com/questions/38246420/what-does-exitcode-1073741502-mean">What does ExitCode -1073741502 mean?</a>)</p>
  
  <p>The commands I am trying to execute in the Docker container work when I run it from the PowerShell in the EC2 host. I can verify by running <code>[Environment]::Is64BitProcess</code> which returns <code>False</code>.</p>
  
  <p>—————————</p>
  
  <p>This is the docker version I am running on the AWS EC2 based off of <code>Windows_Server-2019-English-Full-Base-2020.02.12 (ami-00cb4c0d60b9476f4)</code></p>
  
  <pre><code>PS&gt; docker version
  
  Client: Docker Engine - Community
   Version:           19.03.5
   API version:       1.40
   Go version:        go1.12.12
   Git commit:        633a0ea
   Built:             Wed Nov 13 07:22:37 2019
   OS/Arch:           windows/amd64
   Experimental:      false
  
  Server: Docker Engine - Community
   Engine:
    Version:          19.03.5
    API version:      1.40 (minimum version 1.24)
    Go version:       go1.12.12
    Git commit:       633a0ea
    Built:            Wed Nov 13 07:36:50 2019
    OS/Arch:          windows/amd64
    Experimental:     false
  </code></pre>
  
  <p>Another Update:</p>
  
  <p>The commands actually work when I run from a different EC2 that I had created a while back based off of <code>ami-0d4df21ffeb914d61</code> (Which is also <code>Windows_Server-2019-English-Full-Base</code> but the ami is not public anymore)</p>
  
  <p>Another Update:</p>
  
  <p>Looks like it was an issue with the ami. Was able to make it work with a previous version, <code>Windows_Server-2019-English-Full-Base-2020.01.15 (ami-09f2114fecbe506e2)</code></p>