Hi @DevAsith ,
If it fails at the Get-PnPApp step already, it most probably means you connected to a site using Connect-PnPOnline for which you have not explicitly enabled the site collection app catalog feature. Follow the steps in this document :
https://learn.microsoft.com/en-us/sharepoint/dev/general-development/site-collection-app-catalog#configure-and-manage-site-collection-app-catalogs
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.