Forum Discussion

Joe DeNicola's avatar
Joe DeNicola
Copper Contributor
Mar 08, 2018
Solved

Getting a file's metadata field values using Pnp

Using Powershell Pnp and SharePoint Online, I want to get the values in the custom fields of a file. I do not want to download the file, I just need the custom (metadata) fields.   For example, I...
  • paulpascha's avatar
    Mar 12, 2018

    I've just did a quick test. The following gives me the expected value from a custom column in one of my files:

     

    PS C:\Users\Paul> Connect-PnPOnline https://mytenant.sharepoint.com/sites/test -Credentials $credentials
    PS C:\Users\Paul> $f = Get-PnPFile -Url "/sites/test/Library/Document.pdf" -AsListItem
    PS C:\Users\Paul> $f["CustomField"]
    Custom Field Value

     

    Hope this helps!

Resources