Retrieving Dynamic Software Categories
Retrieving Dynamic Software Categories
Retrieves the specified Dynamic Software Category object(s).
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
Retrieve the Dynamic Software Category object named "Microsoft Software" from the "Global Software Library":
Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\Microsoft Software" -SchemaTag "DynamicSwCategory" |
Retrieve all Dynamic Software Categories from the "Global Software Library" and subordinated directories:
Get-EmdbSoftwareCategory "emdb:\*" -SchemaTag "DynamicSwCategory" -Recurse |
Retrieve all Dynamic Software Categories having their names starting with the substring "S" from the "Global Software Library\Application Library" and subordinated directories:
Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\Application Library\S*" -SchemaTag "DynamicSwCategory" -Recurse |
Retrieve the Dynamic Software Category named "Microsoft Software" from the current context:
Cd "emdb:\rootDSE\Global Software Library\Application Library" Get-EmdbSoftwareCategory "Microsoft Software" -SchemaTag "DynamicSwCategory" |
Retrieve the Dynamic Software Category "Intel-Drivers" in the current context through its Item-ID (this ID will vary in different DSM environments):
Get-EmdbSoftwareCategory -ItemID 9883 -Recurse |
Tip: the alias ID can be used instead of ItemID. |
Retrieve the Dynamic Software Category named "Microsoft Software" from the current context using the cmdlet Get-Item:
Cd "emdb:\rootDSE\Global Software Library\Application Library" Get-Item "Microsoft Software" |
Retrieve all Dynamic Software Categories having their names starting with the substring "S" from the directory "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=DynamicSwCategory)" -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.