Please check following points.
1.Make sure you run SharePoint Management Shell as administrator.
2.When you run PowerShell and ask you to enter your account and password, please make sure the account is SharePoint administrator and site administrator.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.