Terry Wrennall's Profile
Recent Activity
I notice I’ve put this in the wrong forum, should have been in the API/REST forum I cant seem to edit the post **Solved:** invoke-restmethod does not return the response headers by default invoke-webrequest does Capturing those headers in the variable fixes the problem (ps6/7 only likely), code below Invoke-RestMethod @TokenSplat -ResponseHeadersVariable RestSessinToken $ZToken = […]
not sure what happened to my formatting, but it’s good enough now
something that always confused me (and this is probably Zerto specific but I’ll throw it out here) I do all my requests using <strong>invoke-restmethod</strong> execpt 1, the inital <strong>invoke-webrequest</strong> to get my token for example $ZertoServer = ‘zerto-zvm.internaldomain.local’ $ZertoPort = “9669” $ZertoUser = “domain\Zerto-account” $ZertoPassword = “HLlmmt2W4rvcs3hlz8w” $BaseURL = “https://$($ZertoServer):$($ZertoPort)/v1” $AuthInfo = (“{0}:{1}” -f $ZertoUser, […]
Right I have found the property I was looking for $VMList = Invoke-RestMethod -Uri $VMListURL -TimeoutSec 100 -Headers $zertoSessionHeader -ContentType $TypeJSON $VMList | Where-Object {$_.ActiveProcessesApi.RunningFailOverTestApi -ne $null} | select vpgname, VpgIdentifier,@{label=’State’;expression={$_.ActiveProcessesApi.RunningFailOverTestApi | select -ExpandProperty stage}} VpgName VpgIdentifier State ——- ————- —– Authentication-c-DC02 32ef8ce8-e1fe-4066-b0d9-aad5341fa7d2 InTest I’ll then use that to send to the stop fail-over API […]
Thanks, appreciate that