Hi @Rajat Saxena (NON EA SC ALT) Thanks for reaching out. Currently its only supported in the Azure portal, the user can choose to include or exclude hidden resources in the list by checking the box.
The rest api call GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2021-04-01 provides all the resources under the subscription we don't have any filter query that allows any sort of "hidden" property to be passed to filter on the server either through rest api call / Az powershell command.
we have the following github threads discussing the same,
https://github.com/Azure/azure-powershell/issues/10365
https://github.com/Azure/azure-powershell/issues/9102
feel free to provide your feedback at our feedback forum https://feedback.azure.com/d365community/ so that other users who are in need to similar feature can upvote it and Product group team can take it forward.
let me know incase in of further queries, I would be happy to assist you.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.