Problem with Get-PnPSite cmdlet

Respected Contributor

I am connect to the tenant with an admin account but I can't get the get-pnpsite cmdlet to return data. Can someone please tell me what I'm doing wrong?

PS C:\WINDOWS\system32> Get-PnPSite -Includes Features.Count
Get-PnPSite : The query expression 'Param_0.Features.Count' is not supported.
At line:1 char:1
+ Get-PnPSite -Includes Features.Count
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Get-PnPSite], InvalidQueryExpressionException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Site.GetSite

4 Replies

it does not reconize the parameter features.count...

what happens if you only use Get-PnPSite

It works and returns the site url and compatibility level

PS C:\WINDOWS\system32> Get-PnPSite

Url                                                     CompatibilityLevel                                                                            
---                                                     ------------------                                                                            
https://ems195245.sharepoint.com/sites/contoso          15         

I am having a similar problem when using Get-PnPSite -includes Url.  When using the command Get-PnPSite -includes Url it returns the Url of the SharePoint site that I am connected to.  When sent to a parameter $site = Get-PnPSite -includes Url the value in $site = Microsoft.SharePoint.Client.Site so it will not allow me to do something like foreach($Web in $site.AllWebs) returns an error $site has a null value.  All I am trying to do is go through all document sites and list all of the documents in each site.  Cannot get anything to work.

Hi @Dean Gross,

 

Are you trying to get the number of features in a site?

 

Simply run:

$site = Get-PnPSite -Includes Features
$site.Features.Count

This will return the number of features. Count will be included when Features are included.