Forum Discussion
Nigel_Price9911
Apr 10, 2018Iron Contributor
How do I get fieldvalues from a content Type Uisng PnP PowerShell
Hi Get-PnPContentTypes only brings back a subset of all of the site columns in a contenttype. So I have a loop so :- $CTypes = Get-PnPContentType foreach($contentType in $CTypes) { $f...
Nigel Witherdin
May 06, 2018Iron Contributor
Hi,
you need to load collections via the context, so something like:
$CTypes = Get-PnPContentType
foreach($contentType in $CTypes)
{
$ctx = Get-PnPContext
$ctx.Load($contentType.FieldLinks)
$ctx.ExecuteQuery()
$fieldInUse = $contentType.FieldLinks | Where {$_Name -eq $columnInternalName }
# etc.
Thanks
Nigel
Nigel_Price9911
May 09, 2018Iron Contributor
Thanks Nigel