Retrieving User-Defined HTML-Views

In order to retrieve userdefined Context-Menu-Groups, the cmdlet Get-EmdbUserDefinedHtmlView is used.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


The following first example retrieves all User-Defined HTML-View objects:


Get-EmdbUserDefinedHtmlView


To just retrieve all objects of this type, that are visible in the Object-Window, the following command can be used:


Get-EmdbUserDefinedHtmlView | Where-Object {$_.VisibleAs -eq "ObjectWindow"}


If you are looking for a specific HTML-View, you can retrieve it, by providing its name. The code below retrieves the HTML-View "Google" and stores it in a variable:


$MyView = Get-EmdbUserDefinedHtmlView "Google"


It is also possible to specify the Item-ID of the object you want to retrieve (this ID will vary in different DSM environments):


Get-EmdbUserDefinedHtmlView -ItemID 13051


Tip: the alias ID can be used instead of ItemID.


Note: Note that User-Defined HTML-View objects are not part of the context rootDSE and therefore they can be referenced without a full qualified path resp. an absolute path.


Starting with PSX 3.1 there was a new option implemented when retrieving User-Defined HTML-View objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is affected. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.