On 19/10/2015 19:38, Elwin Hidding wrote:
I do not see my last post and cannot find it, so 2nd try.

I am trying to make a connection from PowerShell to the Puppet API.
The CURL example on: http://docs.puppetlabs.com/puppetdb/2.3/api/query/v3/facts.html shows me this:

|
curl -X GET http://puppetdb:8080/v3/facts --data-urlencode 'query=["=", "name", "operatingsystem"]'
|



I can get it to work in PowerShell without the query part with this:

|
Invoke-WebRequest-Uri"http://puppetdb:8080/v3/facts"-MethodGet
|



Has anyone any knowledge on how i can add the query part?

http://stackoverflow.com/a/17330952 shows how to pass arguments to a POST request, I'd assume that the GET works the same.


Invoke-WebRequest -Uri "http://puppetdb:8080/v3/facts"; -Method Get -Body @{query='["=", "name", "operatingsystem"]'}


Cheers, David

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5626678E.2000504%40dasz.at.
For more options, visit https://groups.google.com/d/optout.

Reply via email to