Removing User-Defined HTML-Views

Deletes User-Defined HTML-Views either trough the Remove-EmdbUserDefinedHtmlView cmdlet or through using the Delete()-method.


Examples:


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


The first example deletes the User-Defined HTML-View "LicMgmt":


Remove-EmdbUserDefinedHtmlView "LicMgmt"


Alternatively, the following code snippet first retrieves the object associated with the User-Defined HTML-View "Google" and deletes it subsequently by using the object's Delete()-method:


$MyCustomView = Get-EmdbUserDefinedHtmlView "Google"

$MyCustomView.Delete()


In order to delete all User-Defined HTML-Views, the code shown below can be used, for example:


Get-EmdbUserDefinedHtmlView | ForEach-Object {$_.Delete()}


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 deleting User-Defined HTML-View objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is affected. If the command would delete more than one object, an error is raised that can be caught and handled in scripts.