$? is *really* a poor way to do error handling. You should instead use -ErrorAction and a Try/Catch block. Within the Catch block, you can check $_ or $error[0] to see the error that happened.
↧
$? is *really* a poor way to do error handling. You should instead use -ErrorAction and a Try/Catch block. Within the Catch block, you can check $_ or $error[0] to see the error that happened.