I have a REST response which sets a variable as shown below:
PS H:> echo $response
Success
------- @{count=1; uri=https://server/results/Success}
I can also do:
PS H:> echo $response.Success.uri
I need the uri. However it may possibly at times be on $response.Fail.uri or $response.Error.uri instead of $response.Success.uri
Must all the variants be check in PowerShell separately or is there a way to extract uri regardless of Fail, Response or Success ?
EDIT:
PS H:> Write-Host $response | fl * -f
@{Success=}
$response | fl * -fand see whether the uri is present on a top level.