Pnp-powershell: Get Content Type Fields with Get-PnPContentType

Created on 26 Mar 2018  路  3Comments  路  Source: pnp/PnP-PowerShell

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting

Possibility to get list of fields of content type.
Get-PnPContentType

Expected behavior

Please describe what output you expect to see from PnP-PowerShell Cmdlets

List of all fields of content type (Fields Collection)

Actual behavior

Please describe what you see instead. Please provide samples of HTML output or screenshots

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

Get-PnPContentType
The Fields collection wasn't load . May be add the parameter "Include" ???

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [x] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable)
2.24.1803.0

How did you install the PnP-PowerShell Cmdlets?

  • [x] MSI Installed downloaded from GitHub
  • [ ] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means

Most helpful comment

You can use get-pnpproperty to populate the missing collections.

$ctype = get-pnpcontenttype -identity "Ctype name"
get-pnpproperty -clientobject $ctype -property "Fields"

All 3 comments

You can use get-pnpproperty to populate the missing collections.

$ctype = get-pnpcontenttype -identity "Ctype name"
get-pnpproperty -clientobject $ctype -property "Fields"

Thank you Very much!

Not working (anymore?) for me. With current version, I get the following error:
Get-PnPProperty : The 'subQuery' argument is invalid.

Tried "Fields" with and without quotes. my content type object is valid

EDIT: worked on another tenant. Weird.

Was this page helpful?
0 / 5 - 0 ratings