Retrieving Static Software Categories
Retrieving Static Software Categories
Retrieves the specified Software Category object(s).
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
Retrieve the Static Software Category named "Tools und Utilities" from the "Global Software Library":
Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\Tools und Utilities" -SchemaTag "SwCategory" |
Retrieve all Static Software Categories from the "Global Software Library" and subordinated directories:
Get-EmdbSoftwareCategory "emdb:\*" -SchemaTag "SwCategory" -Recurse |
Retrieve all Static Software Categories having their names starting with the substring "S" from "Global Software Library\Application Library" and subordinated directories:
Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\Application Library\S*" -SchemaTag "SwCategory" -Recurse |
Retrieve the Static Software Category named "Freeware and Open Source" from the current context:
Cd "emdb:\rootDSE\Global Software Library\Application Library" Get-EmdbSoftwareCategory "Freeware and Open Source" -SchemaTag "SwCategory" |
Retrieve the Static Software Category "Packaging" in the current context through its Item-ID (this ID will vary in different DSM environments):
Get-EmdbSoftwareCategory -ItemID 6123 -Recurse |
Tip: the alias ID can be used instead of ItemID. |
Retrieve the Static Software Category named "Freeware and Open Source" from the current context using the cmdlet Get-Item:
Cd "emdb:\rootDSE\Global Software Library\Application Library" Get-Item "Freeware and Open Source" |
Retrieve all Static Software Categories having their names starting with the substring "S" from "Global Software Library\Application Library" and subordinated directories using the cmdlet Get-Childitem:
Get-ChildItem "emdb:\rootDSE\Global Software Library\Application Library" -Filter "&(Name=S*)(SchemaTag=SwCategory)" -Recurse |
Starting with PSX 3.1 there was a new option implemented when retrieving Software Category 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.