Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Example 1. Gets a value that specifies usage information about the site, including bandwidth, storage, and the number of visits to the site collection
$result = .\Invoke-RestSPO.ps1 -Url "https://contoso.sharepoint.com/_api/site/usage" -UserName "username@tenant.onmicrosoft.com" -Password "password"
write-host 'Total amount of disk space, currently being used by the site collection (Mb):' ([math]::round($result.Usage.Storage /1Mb))
#Example 2. Get List Items
.\Invoke-RestSPO.ps1 -Url "https://contoso.sharepoint.com/_api/web/lists/getbytitle('Contacts')/title" -UserName "username@tenatnt.onmicrosoft.com" -Password "password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.