Monday, July 14, 2014

Wait-Object Function Takes Place of Wait-ValueReturned

I previously posted a function Wait-ValueReturned but is did not seem like it flowed with the rest of PowerShell so I re factored the code into Wait-Object but I am not sure about how the command should return. I have considered first return bool from the command to indicate success, which means the command will always return true or false. My other option is to return to object that was being waited on if success and return error record on fail. here is examples of both. Which makes more sense to use in a script

 Returning Bool:

 Returning object or error:

No comments:

Post a Comment