use the new invoke-commandchecked code for error handling