# Load data in Powershell Windows

**URL:** <https://discuss.elastic.co/t/load-data-in-powershell-windows/137027>\
**Category:** Logstash\
**Created:** [June 22, 2018, 1:19pm UTC](https://discuss.elastic.co/t/load-data-in-powershell-windows/137027 "2018-06-22T13:19:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yong\_Rhee](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@Yong\_Rhee](https://discuss.elastic.co/u/Yong_Rhee)\
**Post date:** [June 22, 2018, 1:19pm UTC](https://discuss.elastic.co/t/load-data-in-powershell-windows/137027/1 "2018-06-22T13:19:33Z")

</div>

Trying to load Shakespear example data into elasticsearch using Windows powershell and got this auth error. (I downloaded file on my User/Documents folder by the way)  
I am connected to Elasticsearch port(9200) and Kibana port(5601) successfully and I have gone far to mapping setup before type on Powershell. (PUT method)  
And, I also unzipped Logstash.  
I am Windows machine.  
Plus, I installed Elasticsearch with .msi file so there is no config.yml file on my Elastic 6.3.0 folder as far as I know

```
PS C:\Users\joshu\documents> Invoke-RestMethod "http://localhost:9200/shakespeare/doc/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "shakespeare_6.0.json"
Invoke-RestMethod : {
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "missing authentication token for REST request [/shakespeare/doc/_bulk?pretty]",
        "header" : {
          "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "missing authentication token for REST request [/shakespeare/doc/_bulk?pretty]",
    "header" : {
      "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status" : 401
}
所在位置 行:1 字符: 1
+ Invoke-RestMethod "http://localhost:9200/shakespeare/doc/_bulk?pretty ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod]，WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

PS C:\Users\joshu\documents>
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 20, 2018, 1:19pm UTC](https://discuss.elastic.co/t/load-data-in-powershell-windows/137027/2 "2018-07-20T13:19:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
