0

I am fairly new to PnP PowerShell. I am trying to extract the TotalFileSize property from what the Measure-PnPWeb returns so I can see the total file size from my site.

I've tried extracting to client-side object and just an error that the WebStatistics cannot be converted to a client-side object.

Any idea how to get the values of the properties after running Measure-PnPWeb?

1 Answer 1

0

You need to put it into a variable.

Connect-PnPOnline -Url "https://your-tenant.sharepoint.com" -DeviceLogin
$measurement = Measure-PnPWeb # at this point, you're assigning returned object of Measure-PnPWeb into $measurement
$measurement.TotalFileSize #from which you can use it in any of your expression
if ($measurement.TotalFileSize -gt 1000) {
    #if size > 1000, then do something here...
}

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.