I am trying to install a SPFx Web Part in a Classic SharePoint Online Page using PnP.
First I connect to the tenant
Connect-PnPOnline –Url https://company.sharepoint.com/ –Credentials (Get-Credential)
Then I run this command
Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/Company/Pages/CompanyPage.aspx" -Xml "C:\QLWebPart.xml" -ZoneId "Custom Zone" -ZoneIndex 0
and I get this error:
Add-PnPWebPartToWebPartPage : File Not Found. At line:1 char:1 + Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/Company ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Add-PnPWebPartToWebPartPage], ServerException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.WebParts.AddWebPartToWebPartPage
Which makes no sense because the file exists. I've tried renaming to .xml as well but nothing
What can be wrong?