https://github.com/box/boxcli/blob/08507d0017e3efd280c3e795b0b12cde6614a713/examples/User Deprovisioning/Users_Deprovision.ps1#L246
using 2>&1 surfaces all errors, but since the script fails if there's any error, that means random errors (you're bypassing TLS! etc.) can apparently fail the whole script. What about parsing the error to see if it's really an issue? The error it returns when the script fails on an action - for example, 'Could not get the current user. See log for details.,' could be made more accurate.
https://github.com/box/boxcli/blob/08507d0017e3efd280c3e795b0b12cde6614a713/examples/User Deprovisioning/Users_Deprovision.ps1#L246
using 2>&1 surfaces all errors, but since the script fails if there's any error, that means random errors (you're bypassing TLS! etc.) can apparently fail the whole script. What about parsing the error to see if it's really an issue? The error it returns when the script fails on an action - for example, 'Could not get the current user. See log for details.,' could be made more accurate.