Hi @na ,
I would have the same problem as you by running the code you posted and am currently unable to run PnP Powershell using this login method.
Here are steps:
1.Register a new Azure AD Application ID and Grant Access to the tenant:
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName "PnP PowerShell" -SharePointDelegatePermissions "AllSites.FullControl" -Tenant Salaudeen.onmicrosoft.com -Interactive
2.Using the following PnP PowerShell to Upload File to SharePoint Online Document Library:
#Config Variables
$SiteURL = "https://yourdomain.sharepoint.com/sites/AmyTeam"
$ClientID = "4fad20a5-9008-47d2-9560-f7ff0ddf8c94"
$SourceFilePath ="C:\SharePoint dev Readiness.docx"
$DestinationPath = "Shared Documents" #Site Relative Path of the Library
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive -ClientId $ClientID
#powershell pnp to upload file to sharepoint online
Add-PnPFile -Path $SourceFilePath -Folder $DestinationPath
Output:
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.