SharePoint Online: Import Term Group, Term Set, Term from XML using PnP PowerShell

Requirement: Import Term group, term set and terms data from a XML file to SharePoint Online using PnP PowerShell.

XML File with Term Store Data:
Here is my XML with Term store data
<pnp:TermGroups xmlns:pnp="">
 <!-- Term Group -->
 <pnp:TermGroup Name="Deals Pipeline" Description="">
   <!-- Term Set 1 -->
   <pnp:TermSet Name="Region" Description="">
     <pnp:Term Name="Africa" />
     <pnp:Term Name="Asia" />
     <pnp:Term Name="Australasia" />
     <pnp:Term Name="Europe" />
     <pnp:Term Name="MENA" />
     <pnp:Term Name="America" />
   <!-- Term Set 2 -->
   <pnp:TermSet Name="DealStage" Description="">
     <pnp:Term Name="Deal Identification" />
     <pnp:Term Name="Screening IC" />
     <pnp:Term Name="Post Screening IC" />
     <pnp:Term Name="Final IC" />
     <pnp:Term Name="Pre-Closing IC" />
     <pnp:Term Name="Signed" />
     <pnp:Term Name="ParCo" />

PnP PowerShell to Import Term store data from XML:
#Config Variables
$AdminCenterURL = ""
$XMLPath = "C:\Users\salaudeen\Desktop\Taxonomy.xml"

#Connect to PnP Online
Connect-PnPOnline -Url $AdminCenterURL -Credentials (Get-Credential)

#Import Term store Group, Term Set and Terms from XML
Import-PnPTermGroupFromXml -Path $XMLPath
and the result:
sharepoint online import term group, term set, terms using powershell

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.