Skip to content

Instantly share code, notes, and snippets.

@vgrem
Last active August 29, 2015 14:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Retrieve List resource properties
param (
$ClientId,
$ClientSecret,
$WebUri,
$ListTitle
)
.\Get-SPOAccessToken.ps1
Function Get-SPOList([Uri]$WebUri,[string]$ClientId,[string]$ClientSecret,[Uri]$ListTitle)
{
$accessToken = Get-SPOAccessToken -ClientId $ClientId -ClientSecret $ClientSecret -WebUri $WebUri
$endpointUri = "$WebUri/_api/web/lists/getbytitle('$ListTitle')"
$data = Invoke-SPORestMethod -Uri $endpointUri -AccessToken $accessToken
return $data.d
}
Get-SPOList -WebUri $WebUri -ClientId $ClientId -ClientSecret $ClientSecret -ListTitle $ListTitle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment