Pnp-powershell: Export-PnPTermGroupToXml throws Object reference not set to an instance of an object error

Created on 21 Sep 2017  路  5Comments  路  Source: pnp/PnP-PowerShell

I'm running a simple Export-PnPTermGroupToXml command against an on-prem SP2016 farm. I've tried with different group names or none at all. In all cases I get an Object reference not set to an instance of an object error. Other cmdlets against the local and MMS term store are working fine.

Expected behavior

I expect the command to run. :)

Actual behavior

Export-PnPTermGroupToXml : Object reference not set to an instance of an object.
At line:1 char:1
+ Export-PnPTermGroupToXml
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Export-PnPTermGroupToXml], NullReferenceException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Taxonomy.ExportTermGroup

Steps to reproduce behavior

Connect-PnPOnline -Url https://xxxx
Export-PnPTermGroupToXml

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

PnP PowerShell for SharePoint 2016

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

2.18.1709.0

How did you install the PnP-PowerShell Cmdlets?

Installed through the PowerShell Gallery with Install-Module

Most helpful comment

+1
Working with my previous version 2.16.1706.1

All 5 comments

Same problem here with Sharepoint online! Seems too be related to the latest release

+1
Working with my previous version 2.16.1706.1

Same behavior in SP2013 OnPrem version 2.18.1709.0.
Worked fine in version 2.13.1703.0.
Import-PnPTermGroupFromXml returns the same error.

+1
SharePointPnPPowerShellOnline 2.19.1710.0

+1
Silently fails for me on 2.23.1802.0

[EDIT]
Actually I just discovered that if the target term group is the site collection default term group, then this method doesn't work as intended, and will result in a blank output. Luckily this guy right here found a good fix:
http://sharepoint.handsontek.net/2018/01/14/export-and-import-site-collection-term-groups-using-pnp-powershell/

Was this page helpful?
0 / 5 - 0 ratings