I ran the script using the PowerShell extension in Visual Studio Code.
# Connect to the SharePoint site
$siteURL = "https://gurram.sharepoint.com/sites/dev"
Connect-PnPOnline -Url $siteURL -Interactive
# The name of the document library
$libraryName = "test1"
# Retrieve all list items in the document library
$items = Get-PnPListItem -List $libraryName
# Loop through each item and retrieve FieldValuesForEdit
foreach ($item in $items) {
# Retrieve the FieldValuesForEdit property of the list item
$fieldValuesForEdit = Get-PnPProperty -ClientObject $item -Property "FieldValuesForEdit"
Write-Host "Item ID:" $item.Id
Write-Host "FieldValuesForEdit:"
$fieldValuesForEdit.FieldValues.FileRef #FileReferenceLink
$fieldValuesForEdit.FieldValues._IpLabelId #Label ID
$fieldValuesForEdit.FieldValues._DisplayName #Label Display Name
}
Below screenshot shows the result.
No comments:
Post a Comment