Closed ahmadn82 closed 5 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Workaround:
Connect-PnPOnline -Url https://my.sharepoint.com/sites/yoursite
$field = Get-PnPField -Identity 00000000-0000-0000-0000-000000000000
[Microsoft.SharePoint.Client.Taxonomy.TaxonomyField] $taxonomyFld = [Microsoft.SharePoint.Client.ClientContext].GetMethod("CastTo").MakeGenericMethod([Microsoft.SharePoint.Client.Taxonomy.TaxonomyField]).Invoke($field.Context, $field)
$taxonomyFld.AnchorId = '00000000-0000-0000-0000-000000000000'
$taxonomyFld.UpdateAndPushChanges($true)
Invoke-PnPQuery
@ahmadn82 Figured parsing and verifying the xml would be too complicated. Instead fixed so that Get-PnPField
return a TaxonomyField
type, so that you can skip the casting line at least. Hope this helps.
I am not able to retrieve the Taxonomy field type using the Get-PnpField command.. Is there an explicit typecast required ?
Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:
Apply-SPOProvisioningTemplate
orGet-SPOProvisioningTemplate
? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.Reporting an Issue or Missing Feature
When trying to change the AnchorId property for a TaxonmoyField by changing/updating the field's SchemaXml then updating, the field doesn't change/update the field's SchemaXml (AnchorId property changes the set of terms available for selection in a managed metadata column)
Expected behavior
Updating/changing a field's SchemaXml property - with a new AnchorId - then updating the field, should update/change the field's SchemaXml
Actual behavior
Field SchemaXml property is not updated
Steps to reproduce behavior
Whether you are using Set-PnPField OR $field.UpdateAndPushChanges() Invoke-PnPQuery This doesn't update the field's SchemaXml
https://twitter.com/ahmadn82/status/1139521536442941440
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
3.4.1812.2 SharePointPnPPowerShellOnline
How did you install the PnP-PowerShell Cmdlets?