Get-PnPWebPart returns no results for modern SPO pages

%3CLINGO-SUB%20id%3D%22lingo-sub-266782%22%20slang%3D%22en-US%22%3EGet-PnPWebPart%20returns%20no%20results%20for%20modern%20SPO%20pages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-266782%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%20PnP%20Powershell%2C%26nbsp%3BGet-PnPWebPart%26nbsp%3Breturns%20no%20results.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24webParts%20%3D%20Get-PnPWebPart%20-ServerRelativePageUrl%20%22%2Fsites%2FSampleSite%2FSitePages%2FABC.aspx%22%3C%2FP%3E%3CP%3E%24webParts.Count%20%3D%200%3C%2FP%3E%3CP%3EABC.aspx%20is%20a%20page%20in%20the%20Site%20Pages%20library%20within%20a%20modern%20team%20site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-PnPFile%20successfully%20returns%20the%20page.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20assist.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-266782%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-268650%22%20slang%3D%22en-US%22%3ERe%3A%20Get-PnPWebPart%20returns%20no%20results%20for%20modern%20SPO%20pages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-268650%22%20slang%3D%22en-US%22%3E%3CP%3EUse%20PnPClientSidePage%26nbsp%3Bto%20retrieve%20controls%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Using PnP Powershell, Get-PnPWebPart returns no results. 

 

$webParts = Get-PnPWebPart -ServerRelativePageUrl "/sites/SampleSite/SitePages/ABC.aspx"

$webParts.Count = 0

ABC.aspx is a page in the Site Pages library within a modern team site.

 

Get-PnPFile successfully returns the page.

 

Please assist.

1 Reply
Highlighted

Use PnPClientSidePage to retrieve controls