Reputation: 383
I am trying to delete elasticsearch template in Windows, however, it keeps giving me error result like this.
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
Is there anyway to resolve the issues?
Upvotes: 1
Views: 396
Reputation: 58931
curl
is an alias for the Invoke-WebRequest cmdlet:
get-command curl | select Name
Name
----
curl
-XGET
is equivalent to -Method Get
which is the default. So this should work:
Invoke-WebRequest 'http://localhost:9200/_template/'
Note: You probably have to adopt the scheme.
Upvotes: 1