Get-PnpListItem retrieves a SharePoint list item by list name and ID. In request-processing automation, pass the item ID from a watcher script, authenticate in the processing context, and avoid repeating XML queries. section 11.3.3
Use the returned object according to the field type:
- Read ordinary fields such as Title directly from the item. section 11.3.3
- Access fields through the item hashtable with square brackets and the field’s internal name. section 11.3.3
- Resolve lookup fields through their LookupId or related properties; retrieve the referenced template item when its internal name is required. section 11.3.3
Retrieve a site request
$item = Get-PnpListItem -List 'Site Requests' -Id 1 $item['Title'] $item['Author'] $item['Template'] $templateItem = Get-PnpListItem -List 'Site Templates' -Id $item['Template'].LookupId $templateItem['Name'] section 11.3.3
$item = Get-PnpListItem -List 'Site Requests' -Id 1
$item['Title']
$item['Author']
$item['Template']
Posh Tester
Email LookupId LookupValue
----- -------- -----------
user@<sub>.onmicrosoft.com 6 Matthew Dowst
LookupId LookupValue TypeId
-------- ----------- ------
15 Communication site {f1d34cc0-9b50-4a78-be78-d5facfcccfb7}
Inspect the returned item and observe how ordinary and lookup fields expose their values. section 11.3.3
