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
Following lines need to be updated to either utilize
throwused instead of callingStop-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-Functionso it shows proper messaging system text instead of red errors:https://github.com/sqlcollaborative/dbatools/blob/5a3e806868725cc7729f006ab915614a8d278550/functions/Update-DbaInstance.ps1#L289-L293