Skip to content

Instantly share code, notes, and snippets.

@vgrem
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgrem/9259675 to your computer and use it in GitHub Desktop.
Save vgrem/9259675 to your computer and use it in GitHub Desktop.
#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