It was my understanding that anything that writes to $error should be re-directable to $null, but I can't make it work, even with something as simple as substring or a bad cmdlet name:
PS C:\WINDOWS\system32> asdf 2>$null
asdf : The term 'asdf' is not recognized as the name of a cmdlet...
All of the examples here do not seem to work: Redirecting output to $null in PowerShell, but ensuring the variable remains set
PS C:\WINDOWS\system32> $qwerty = "a"
PS C:\WINDOWS\system32> $qwerty.substring(0,2) 2>$NULL
Exception calling "Substring" with "2" argument(s): "Index and length...
PS C:\WINDOWS\system32> $qwerty.substring(0,2) | out-null
Exception calling "Substring" with "2" argument(s): "Index and length...