Skip to content

Instantly share code, notes, and snippets.

@itsthedoc
Created February 27, 2019 20:11
Show Gist options
  • Save itsthedoc/d1fe52b8ea4370212b3e681598287c19 to your computer and use it in GitHub Desktop.
Save itsthedoc/d1fe52b8ea4370212b3e681598287c19 to your computer and use it in GitHub Desktop.
Import-Module SharePointPnPPowerShell2013 -DisableNameChecking
Connect-PnPOnline -Url "https://sharepoint/sites/mainsitepage" -CurrentCredentials # if logged into domain
$list = Get-PnPList -Identity "917d9483-d6c4-4f47-8f88-4beac30df4a1" ## Tip: Use Get-PnPlist with no identity to find your list ID
$context = Get-PnPContext
$web = $context.web
$context.Load($web)
$fields = $list.Fields
$context.Load($fields)
$query = New-Object Microsoft.SharePoint.Client.CamlQuery
$items = $list.GetItems($query)
$context.Load($items)
$context.ExecuteQuery()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment