Get-PnPContentType Format-List #431
-
Is there a way to see all the properties of the content type? Format-List seems to not work for this:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi - This was not an issue with the cmdlet, so I transferred it as a discussion. |
Beta Was this translation helpful? Give feedback.
-
CSOM (underlying api behind the most of the PnP cmdlets) by design rather than returning every property back only returns a subset of properties for Content Type i.e. Name, id etc. This is different from the on premise SharePoint PowerShell world where all properties would be returned. If you want to retrieve any further properties you need to know the name of the property (can be found with Get-Member) and then explicitly request it using Get-PnPProperty Run the following command piping Get-PnPContentType into the Get-Member cmdlet which will then give you a list of properties and methods that are available. Get-PnPContentType | Get-Member Identify the property that you want to retrieve i.e. Fields.
$contentType = Get-PnPContentType -Identity Document
Get-PnPProperty -ClientObject $contentType -Property Fields
$contentType.Fields |
Beta Was this translation helpful? Give feedback.
CSOM (underlying api behind the most of the PnP cmdlets) by design rather than returning every property back only returns a subset of properties for Content Type i.e. Name, id etc. This is different from the on premise SharePoint PowerShell world where all properties would be returned.
If you want to retrieve any further properties you need to know the name of the property (can be found with Get-Member) and then explicitly request it using Get-PnPProperty
Run the following command piping Get-PnPContentType into the Get-Member cmdlet which will then give you a list of properties and methods that are available.
Identify the property that you want to retrieve…