I am reusing terms and I would like to set the SourceTerm but I could not figure out how to do this…
Here is my code:
$ url = "http://MySite:9000/" $ web = Get-SPWeb $ url $ taxonomySession = Get-SPTaxonomySession -Site $ web.Site $ termStore = $ taxonomySession.TermStores["Managed Metadata Service"]; foreach($ item in $ termStore.Groups){ if($ item.Name -eq "Finance") { $ group = $ item } } $ termset = $ group.TermSets["Finance Document Types"]; foreach($ t in $ termset.Terms) { Write-Host "----------First Level: ----------------"; Write-Host $ t.Name"|"$ t.Id "|" $ t.IsSourceTerm }
$ t.IsSourceTerm is giving me true or false but this is a read only function.
I have another term set called “Document Types” which includes all other document types(Sales, Marketing, etc…). I would like to make sure that all terms under Finance Document Types are using terms under Document Types as their source.
any sample powershell code would be much appreciated…