Friday, January 8, 2021

Automate BRE Xml File Import - PowerShell Code, Part 2

BRE comes in two flavors - Policies and Vocabularies.  In the previous post, I gave an overview on how to publish a Policy via code.  

What about Vocabularies?  

The process is somewhat similar, but the methods are a little different.  In a Policy, you need to add the Policy, and then deploy it (optional) if you want it active.  For a Vocabulary, you just need to add it, since Vocabularies don't get deployed.

Also, if a Policy uses a Vocabulary, the Vocabulary needs to be added first (much like an assembly reference).

The code snippet below gives an overview of how I accomplished this.