Forum Discussion

tiny_taka's avatar
tiny_taka
Copper Contributor
Nov 29, 2022

How to get "FileRef" etc.

Connect to the SharePoint site and
 Get-PnPListItem -List "Shared%20Documents
to get a list of "Id", "Title", and "GUID".

 

 Get-PnPListItem -List "Shared%20Documents -Fields "FileRef", "Created", "Author","_DisplayName"
will show only "Id".

 

I thought I could get "FileRef", "Created", "Author", and "_DisplayName" with the "-Fields" option.
However, I cannot get them.
How can I get "FileRef" etc.?

1 Reply

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    tiny_taka 

    The values are inside the "FieldValues" Property

    Get-PnPListItem -List "Documents" -Fields "FileRef", "Created", "Author","_DisplayName"|foreach-object{ 
    Write-Host $_.FieldValues.FileRef
    }

Resources