# PowerShell Provisioning step had errors

**URL:** <https://discuss.hashicorp.com/t/powershell-provisioning-step-had-errors/9959>\
**Category:** Packer\
**Created:** [June 15, 2020, 8:32am UTC](https://discuss.hashicorp.com/t/powershell-provisioning-step-had-errors/9959 "2020-06-15T08:32:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![0ni0nrings](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/0ni0nrings/32/7896_2.png) [@0ni0nrings](https://discuss.hashicorp.com/u/0ni0nrings)\
**Post date:** [June 15, 2020, 8:32am UTC](https://discuss.hashicorp.com/t/powershell-provisioning-step-had-errors/9959/1 "2020-06-15T08:32:37Z")

</div>

I am trying to run below code as PowerShell provisioner inline but Packer throws error “Provisioning step had errors”

```auto

{
            "type": "powershell",
            "inline":[
                "$NewCert=New-SelfSignedCertificate -CertstoreLocation Cert:\\LocalMachine\\My -DnsName 'packer'",
                "New-Item -Path WSMan:\\LocalHost\\Listener -Transport HTTPS -Address * -CertificateThumbPrint $NewCert.Thumbprint -Force"

            ]
        }

```

At the end, I get this error message…

```auto
==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Error processing command: Error uploading ps script containing env vars: Error uploading file to $env:TEMP\winrmcp-9d237844-bb3d-4226-5149-8221a9f046b1.tmp: Couldn't create shell: http response error: 401 - invalid content type

==> Builds finished but no artifacts were created.

```

If I increase the logs then the screen is filled with invalid content type errors…

```auto
Error processing command: Error uploading ps script containing env vars: Error uploading file to $env:TEMP\winrmcp-9d237844-bb3d-4226-5149-8221a9f046b1.tmp: Couldn't create shell: http response error: 401 - invalid content type

```
