With Powershell, I want to run the following command and store the status_url as a variable. I am unable to reference the status_url directly though.
$upload = curl.exe -u username:password -i -F filedata=@filename.csv https://sitename.com/csv
$upload stores the following info:
PS C:\Scripts> $upload HTTP/2 200 content-type: text/html; charset=utf-8 strict-transport-security: max-age=31536000; includeSubDomains content-security-policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com https://cdn.ravenjs.com https://cdn.mxpnl.com https://ssl.google-analytics.com http s://.googleapis.com https://cdn.segment.com https://d2yyd1h5u9mauk.cloudfront.net https://.typeform.com;connect-src 'self' https://api.mixpanel.com https://web.delighted.com https://a pi.segment.io;object-src 'self';style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://use.fontawesome.com https://fonts.gstatic.com https://fonts.googleapis.com;font-src 'self' https://cdnjs.cloudflare.com https://use.fontawesome.com https://fonts.gstatic.com; x-xss-protection: 1; mode=block x-content-type-options: nosniff referrer-policy: strict-origin set-cookie: session=d9337cbf2c313e12_5c24fe8c.Bg33P1e8TOQs9sDCpRWwOoSDDao; Domain=.rolepoint-qa.com; Secure; HttpOnly; Path=/ x-cloud-trace-context: 2586e15ea742ba3202516d6c9c58d3d2;o=1 date: Thu, 27 Dec 2018 16:32:12 GMT server: Google Frontend content-length: 94 expires: Thu, 27 Dec 2018 16:32:12 GMT cache-control: private
{"result": {"status_url": "https://sitename.com/csv/v1/status/1234567"}}
How can I just reference the status_url itself so I can use it in a GET to check the upload status?
The output is JSON, do I need to parse $upload or is there a way to reference $upload.status_url