在Windows中删除elasticsearch模板

我试图删除Windows中的elasticsearch模板,但是,它一直给我这样的错误结果。

PS C:\Users\Administrator> curl -XGET localhost:9200/_template/ Invoke-WebRequest : A parameter cannot be found that matches parameter name 'XGET'. At line:1 char:6 + curl -XGET localhost:9200/_template/ + ~~~~~ + CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand PS C:\Users\Administrator\Downloads\curator> curl GET localhost:9200/_template/ Invoke-WebRequest : A positional parameter cannot be found that accepts argument 'localhost:9200/_template/'. At line:1 char:1 + curl GET localhost:9200/_template/ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand 

有没有解决问题?

curl是Invoke-WebRequest cmdlet的别名:

 get-command curl | select Name Name ---- curl 

-XGET相当于-XGET -Method Get这是默认的。 所以这应该工作:

 Invoke-WebRequest 'http://localhost:9200/_template/' 

注意:您可能必须采用该方案。