Import-SPTerms

Import the Managed Metadata Terms.

Import-SPTerms -TaxonomySession <SPTaxonomySessionPipeBind> -InputFile <XmlDocumentPipeBind> [-AssignmentCollection [<SPAssignmentCollection>]]

Import-SPTerms -ParentTermStore <SPTaxonomyTermStorePipeBind> -InputFile <XmlDocumentPipeBind> [-AssignmentCollection [<SPAssignmentCollection>]]

Import-SPTerms -ParentGroup <SPTaxonomyGroupPipeBind> -InputFile <XmlDocumentPipeBind> [-AssignmentCollection [<SPAssignmentCollection>]]

Import-SPTerms -ParentTermSet <SPTaxonomyTermSetPipeBind> -InputFile <XmlDocumentPipeBind> [-AssignmentCollection [<SPAssignmentCollection>]]

Import-SPTerms -ParentTerm <SPTaxonomyTermPipeBind> -InputFile <XmlDocumentPipeBind> [-AssignmentCollection [<SPAssignmentCollection>]]

Parameters

1

ParameterRequiredTypeDescription
TaxonomySessionTrueSPTaxonomySessionPipeBind

The TaxonomySession object to import Term Stores into.

InputFileTrueXmlDocumentPipeBind

The path to the file containing the terms to import or an XmlDocument object or XML string.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

2

ParameterRequiredTypeDescription
ParentTermStoreTrueSPTaxonomyTermStorePipeBind

The TermStore object to import Groups into.

InputFileTrueXmlDocumentPipeBind

The path to the file containing the terms to import or an XmlDocument object or XML string.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

3

ParameterRequiredTypeDescription
ParentGroupTrueSPTaxonomyGroupPipeBind

The Group object to import Term Sets into.

InputFileTrueXmlDocumentPipeBind

The path to the file containing the terms to import or an XmlDocument object or XML string.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

4

ParameterRequiredTypeDescription
ParentTermSetTrueSPTaxonomyTermSetPipeBind

The TermSet object to import Terms into.

InputFileTrueXmlDocumentPipeBind

The path to the file containing the terms to import or an XmlDocument object or XML string.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

5

ParameterRequiredTypeDescription
ParentTermTrueSPTaxonomyTermPipeBind

The Term object to import Terms into.

InputFileTrueXmlDocumentPipeBind

The path to the file containing the terms to import or an XmlDocument object or XML string.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

Import the Managed Metadata Terms.

Copyright 2016 Falchion Consulting, LLC

> For more information on this cmdlet and others:

> http://blog.falchionconsulting.com/

> Use of this cmdlet is at your own risk.

> Gary Lapointe assumes no liability.

Examples

------------------EXAMPLE 1-----------------------

PS C:\> Import-SPTerms -TaxonomySession "http://site/" -InputFile "c:\terms.xml"

This example imports the terms from c:\terms.xml to the Term Store associated with http://site.

------------------EXAMPLE 2-----------------------

PS C:\> Import-SPTerms -ParentTermStore (Get-SPTaxonomySession -Site "http://site/").TermStores[0] -InputFile "c:\terms.xml"

This example imports the Group from c:\terms.xml to the first Term Store.