Posting the answer to help community, **to resolve the error** execute the PowerShell script as a normal user and set the execution policy as unrestricted:
```powershell
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
```

***I am able to execute the script successfully:***
```powershell
$appId = "AppID"
$appSecret = ConvertTo-SecureString -String "Secret" -AsPlainText -Force
$tenantId = "TenantID"
$credential = [PSCredential]::new($appId, $appSecret)
$tokenSplat = @{
ApplicationId = $appId
Credential = $credential
Scopes = "https://api.partnercenter.microsoft.com/user_impersonation"
ServicePrincipal = $true
TenantId = $tenantId
UseAuthorizationCode = $true
}
$token = New-PartnerAccessToken @tokenSplat
$token.RefreshToken
$connectSplat = @{
ApplicationId = $appId
Credential = $credential
RefreshToken = $token.RefreshToken
}
Connect-PartnerCenter @connectSplat
Get-PartnerRole
```

**Note** that: It is not possible to get a list of our Partner Center customer tenants without access to the Partner Center API as we do not meet the criteria to access it.
Hence, you must be having access to the Partner Center API. ***In case if you get access check the below***:
Connect to Partner Center, use the below script:
```powershell
$appId = "ClientID"
$appSecret = ConvertTo-SecureString -String "Secret" -AsPlainText -Force
$tenantId = "TenantID"
$credential = [PSCredential]::new($appId, $appSecret)
$tokenSplat = @{
ApplicationId = $appId
Credential = $credential
Scopes = "https://api.partnercenter.microsoft.com/user_impersonation"
ServicePrincipal = $true
TenantId = $tenantId
UseAuthorizationCode = $true
}
$token = New-PartnerAccessToken @tokenSplat
$token.RefreshToken
```

Now connect to Partner Center:
```perl
$connectSplat = @{
ApplicationId = $appId
Credential = $credential
RefreshToken = $token.RefreshToken
}
Connect-PartnerCenter @connectSplat
```
As confirmed by you as you have the access there is no way to get access to Partner Center API.
>**Is there maybe a way to view the tenants that are consented with the app? Shouldn't the Graph API have a way to see that?**
To fetch the tenants the multitenant application has consented, you need to be the user of that particular tenant.
- Hence, there is no way to view the tenants that are consented with the app via Microsoft Graph API or any other API.
**Reference:**
[Azure AD Multi-tenant App - Find what tenant provided admin consent - Stack Overflow](https://stackoverflow.com/questions/70451256/azure-ad-multi-tenant-app-find-what-tenant-provided-admin-consent) by RamaraoAdapa