Skip to content

Instantly share code, notes, and snippets.

@vgrem

vgrem/Get-SPOList.ps1

Last active Aug 29, 2015
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
You can’t perform that action at this time.