This is a snip from the ado project
$PSCmdlet.ThrowTerminatingError(
[System.Management.Automation.ErrorRecord]::new(
([System.Management.Automation.ItemNotFoundException]"Not connected to Azure DevOps, please run Connect-AzDevOpsOrganization"),'Projects.Functions',
[System.Management.Automation.ErrorCategory]::OpenError,$MyObject
)
)
This is a snip from the ado project