PowerShell doesn't support a GET request with a body, so you need to use POST instead as @dadoonet suggests.
If you need to work with Elasticsearch frequently with PowerShell, you may be interested in using Elastic.Console, a small PowerShell module that provides cmdlets for
- executing requests
- API path autocompletion
- ability to convert from and execute Kibana Console examples.