We have a powershell script that download data from an url, verify the data using some generic and simple rules and return success or failed (0 or 1). Here is an example
Get-data -uri "http://www.google.com/some_path"
This script is used successfully in many situations. However, in some cases the simple rules implemented in the Get-data script is not enough to verify the data. We do not want to add a lot of domain specific rules into the Get-data. It would be much better if the parent script performed the additional verification but then it needs access to the raw data. How can we return both a boolean return value of success \ failed and a data object?