You should be able to add -ErrorAction SilentlyContinue to the command that is throwing an error for you. See: https://serverfault.com/questions/336121/how-to-ignore-an-error-in-powershell-and-let-it-continue