Retrieving Software-Shop Folders
Retrieving Software-Shop Folders
Since FrontRange DSM 7 it is possible to organize and group the Packages shown in the Software-Shop userinterface using a hierarchical folder structure. This section describes, how the currently defined Software-Shop Folders can be retrieved. The cmdlet Get-EmdbSoftwareShopUIFolder is used for retrieving Software-Shop Folders.
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
If you want to retrieve all defined Software-Shop Folder objects, just execute the cmdlet without further parameters:
Get-EmdbSoftwareShopUIFolder |
If you want to retrieve just one Software-Shop Folder object depending on its name, you specify the name using the Path-parameter. As this is the default parameter, the parameter-name can be omitted:
$MySWShopFolder = Get-EmdbSoftwareShopUIFolder "Image Editing" |
In the graphical userinterface of the DSMC, Software-Shop Folders are organized in a hierarchical structure. On the other hand, the objects themselves are located in the virtual root container rootCatalog which has a flat representation of the data contained. Each of the Software-Shop Folder objects has a property ParentSwShopUIFolderId, which contains the unique ID of the parent Software-Shop Folder (at least, if the object in question has a parent).
In order to retrieve all Software-Shop Folders underneath the Folder "Image Editing", you can use the following script-code:
$MySWShopFolderId = (Get-EmdbSoftwareShopUIFolder "Image Editing").ID Get-EmdbSoftwareShopUIFolder | Where-Object {$_.ParentSwShopUIFolderId -eq $MySWShopFolderId} |
Retrieve the Software-Shop Folder "Systemtools" through its Item-ID (this ID will vary in different DSM environments):
Get-EmdbSoftwareShopUIFolder -ItemID 2978 |
Tip: the alias ID can be used instead of ItemID. |
Note: Note that Software-Shop Folder-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 Software-Shop Folder objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is contained in the result. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.