dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Get-DbatoolsError: Use FullyQualifiedErrorId to filter $global:error #9397

Closed andreasjordan closed 3 days ago

andreasjordan commented 2 weeks ago

Type of Change

Maybe it's only my system, but the ScriptStackTrace does not contain "dbatools". I think it's because the commands are not imported from a file but a compressed file.

image

But "dbatools" is present in the FullyQualifiedErrorId. So we should use this. image

Or is there a better way to filter?

andreasjordan commented 2 weeks ago

The test passed in the past because of the way the tests import the module: They use the file by file method, so the filename and thus "dbatools" is part of the stack trace...

potatoqualitee commented 3 days ago

ah ha! appreciate the pr