Skip to content

Get-SqlInstanceComponent - Internal function needs throw used instead of Stop-Function #4988

@wsmelton

Description

@wsmelton

Following lines need to be updated to either utilize throw used instead of calling Stop-Function, or simply don't wrap the call to invoke in a try/catch so it throws the desired error properly to the parent caller.

https://github.com/sqlcollaborative/dbatools/blob/5a3e806868725cc7729f006ab915614a8d278550/internal/functions/Get-SqlInstanceComponent.ps1#L300-L304

In conjunction with this the reference call made in the parent command should be wrapped in try/catch block with Stop-Function so it shows proper messaging system text instead of red errors:

https://github.com/sqlcollaborative/dbatools/blob/5a3e806868725cc7729f006ab915614a8d278550/functions/Update-DbaInstance.ps1#L289-L293

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions