Adding Members to Static Software Categories

Members can be added to Static Software Categories by calling the method AddMember() of the Software Category object.

Examples:


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


Add the Software Package named "FileZilla 3.0.8.1" as a member to the Static Software Category named "System-Tools" in the "Global Software Library":


$MySwCategory = Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\System-Tools" -SchemaTag "SwCategory"

$MySwPackage = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Application Library\FileZilla\FileZilla 3.0.8.1"

$MySwCategory.AddMember($MySwPackage)


Add the Software Package named "Office 14 Beta German" from the directory "Global Software Library\Application Library\Beta" as a member to the Static Software Category named "Office 14".The Software Category itself is an object in the context "Global Software Library\Application Library\Microsoft", that is different from the context of the software package "Office 14 Beta German":


$MySwCategory = Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\Application Library\Microsoft\Office 14" -SchemaTag "SwCategory"

$MySwPackage = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Application Library\Beta\Office 14 Beta German"

$MySwCategory.AddMember($MySwPackage)