pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

Get Content Type Fields with Get-PnPContentType #1483

Open joaojmendes opened 6 years ago

joaojmendes commented 6 years ago

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?

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?

cimares commented 6 years ago

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

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

joaojmendes commented 6 years ago

Thank you Very much!

umaknow-francis commented 5 years ago

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.