12Knocksinna / Office365itpros

Office 365 for IT Pros PowerShell examples
MIT License
1.28k stars 567 forks source link

Add file count metrics #27

Closed awdhaan closed 3 years ago

awdhaan commented 3 years ago

One thing I was missing in this awesome script, was the file count as this also indicates activity for a team or group. I added this getting the list ItemCount and LastItemUserModifiedDate properties from the default document library using PnP. To support different languages (and therewith different names for the default document library), I used the following to retrieve the list:

$list = Get-PnPList | Where-Object {$_.RootFolder.ServerRelativeUrl -like "$($team.SharePointDocumentsUrl.Split('/')[5])"}

It does add another module to the script and impacts performance, but the output is worth it :-)

12Knocksinna commented 3 years ago

It's PowerShell, so you're able to add whatever data makes sense to you. For now, I won't add this to the script because I am trying to get rid of modules. I'll consider updating the Graph-based version (V5.1) with this information.