Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

andreasjordan
Copy link
Contributor

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

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
Copy link
Contributor Author

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
Copy link
Member

ah ha! appreciate the pr

@potatoqualitee potatoqualitee merged commit 186227f into development Jun 29, 2024
13 checks passed
@potatoqualitee potatoqualitee deleted the GetDbatoolsError_fix branch June 29, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants