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

ScubaConfig initializer exception for Invoke-SCuBA and Initialize-SCuBA #1369

Open
buidav opened this issue Oct 21, 2024 · 0 comments · May be fixed by #1387
Open

ScubaConfig initializer exception for Invoke-SCuBA and Initialize-SCuBA #1369

buidav opened this issue Oct 21, 2024 · 0 comments · May be fixed by #1387
Assignees
Labels
bug This issue or pull request addresses broken functionality
Milestone

Comments

@buidav
Copy link
Collaborator

buidav commented Oct 21, 2024

🐛 Summary

When running on systems (in this cause a Debian distro) where $env:USERPROFILE is null this cryptic exception pops us.

`OperationStopped`: The type initalizer for `ScubaConfig` threw an exception`

Had to run this below to see this source error in ScubaConfig.psm1.

try {
       Initialize-SCuBA
}
catch {
   $_.Exception.InnerExecption
} 

Fix is to add error handling to the DefaultOPAPath assignment line.

Original line.
Image

The fix.
Image

To reproduce

Run Initialize-SCuBA or Invoke-SCuBA on Linux and/or Macs with PowerShell 7.

Expected behavior

For ScubaGear not to throw a cryptic exception on initially running.

@buidav buidav added the bug This issue or pull request addresses broken functionality label Oct 21, 2024
@schrolla schrolla added this to the Lionfish milestone Oct 21, 2024
@buidav buidav self-assigned this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants