In the previous recipe, Understanding extension of Type Data, we used the Update-TypeData cmdlet to add members. However, we said that the update was valid as long as the session was. Now, there could be two ways by which to make the type data stick across sessions:
- Using the PowerShell profile.
- Using an XML file
PowerShell profile is straightforward. However, usually, the type data extension and formatting rules are packaged as part of PowerShell modules. And adding code to the profile is not particularly helpful in that case. In this recipe, we will write a simple XML (.ps1xml) file that we will load in order to extend the type data.