PowerShell error when running job on Windows

Overview

When we run the following command go test -v -run TestDockerCommandSuccessRun gitlab.com/gitlab-org/gitlab-runner/executors/docker we see the following error in the job log:

[0KRunning with gitlab-runner development version (HEAD)
[0;m[0K  on  59bd9a4f
[0;m[0K[36;1mPreparing the "docker-windows" executor[0;m
[0;m[0KUsing Docker executor with image mcr.microsoft.com/windows/servercore:1809 ...
[0;m[0KUsing locally found image version due to if-not-present pull policy
[0;m[0KUsing docker image sha256:8c642ac259165c0b43fbbbde61b5d5ef923de8fd4510113e9b1a08648c2d4c36 for mcr.microsoft.com/windows/servercore:1809 ...
[0;m[0K[36;1mPreparing environment[0;m
[0;mAn error occurred while creating the pipeline.
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : RuntimeException

Running on RUNNER-59BD9A4F via
vagrant-2019...
[0K[36;1mGetting source from Git repository[0;m
[0;mAn error occurred while creating the pipeline.
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : RuntimeException

[32;1mFetching changes...[0;m
Initialized empty Git repository in c:/builds/gitlab-org/ci-cd/tests/gitlab-test/.git/
[32;1mCreated fresh repository.[0;m
[32;1mChecking out 91956efe as master...[0;m
git-lfs/2.7.1 (GitHub; windows amd64; go 1.11.5; git 6b7fb6e3)

[32;1mSkipping Git submodules setup[0;m
[0K[36;1mExecuting "step_script" stage of the job script[0;m
[0;mAn error occurred while creating the pipeline.
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : RuntimeException

[32;1m$ echo Hello World[0;m
Hello
World
[32;1mJob succeeded
[0;m--- PASS: TestDockerCommandSuccessRun (32.86s)
PASS
ok      gitlab.com/gitlab-org/gitlab-runner/executors/docker    35.507s

Notice the error:

[0;mAn error occurred while creating the pipeline.
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : RuntimeException

Running a CI job with GitLab on the same version of Windows/Runner doesn't show this error, so it might be something related to how we set up the tests:

Running with gitlab-runner 13.3.0~beta.263.ga27cdc52 (a27cdc52)
  on docker-windows 3rRLwAVs
Preparing the "docker-windows" executor
00:00
Using Docker executor with image mcr.microsoft.com/windows/servercore:1809-amd64 ...
Using locally found image version due to if-not-present pull policy
Using docker image sha256:528a5fb201d35ba08a4ae7e3ea8909e8ba961d9747f55742f2c2683231f5fc00 for gitlab/gitlab-runner-helper:x86_64-latest-servercore1809 ...
Using locally found image version due to if-not-present pull policy
Using docker image sha256:1d86b55133f02b7011efefa8faaa8f795f50edbdf742a877cb065ff6cb91a9d1 for mcr.microsoft.com/windows/servercore:1809-amd64 ...
Preparing environment
Running on RUNNER-3RRLWAVS via 
vagrant-2019...
Getting source from Git repository
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in c:/builds/root/playground/.git/
Checking out 51190623 as master...
git-lfs/2.7.1 (GitHub; windows amd64; go 1.11.5; git 6b7fb6e3)
Skipping Git submodules setup
Executing "step_script" stage of the job script
$ echo "hello"
hello
Job succeeded

If we revert !2199 (merged) with git revert -m 1 79911f89b70dcbb1f16ca7a1242d5919aef52c4a it fixes the problem.