Exception when the required functions for the BOM window are in a different file

Issue

When using the powerGate BOM Window and having the required functions in a different PowerShell script the following warning is logged when the functions contain the Add-BomWindowEntity cmdlet.

2019-10-23 16:53:54,222 [Pipeline Execution Thread] WARN  powerGate.UI.Cmdlets.Cmdlets.PsPropertiesArgument [(null)] - Following Properties are filtered out because of their ValueType: Property Compliance (Historical),Visualization Attachment,_VaultStatus,_Compliance,_NumManualAttachments,Category Glyph (Historical),_Compliance(Ver),Thumbnail,_CategoryGlyph(Ver),_EntityType,Vault Status,_VisualizationAttachment,Classification,Children,Property Compliance,_EntityIcon,_Thumbnail,Entity Icon,Category Glyph,_Classification,Number of Attachments,Entity Type,_CategoryGlyph
2019-10-23 16:53:54,272 [Pipeline Execution Thread] WARN powerGate.UI.Cmdlets.Modules.UiModule [(null)] - UiModule.Load({Autofac.ContainerBuilder}) | Failed, exception = {ArgumentNullException}.
System.ArgumentNullException: Value cannot be null.
Parameter name: instance
at Autofac.RegistrationExtensions.RegisterInstance[T](ContainerBuilder builder, T instance)
at powerGate.UI.Cmdlets.Modules.UiModule.Load(ContainerBuilder builder)

Cause

This can occur when the script that contains the required functions is a module file (*.psm1).

Solution

To avoid this make sure that the file that contains the functions is a script file with the extension*.ps1.