Removing Static Software Categories
Removing Static Software Categories
Deletes the specified Static Software Category object(s).
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
This code removes the Static Software Category "System-Tools" in the context "Global Software Library":
Remove-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\System-Tools" |
The following snippet deletes the Static Software Category "Office 14" in the current context:
Cd "emdb:\rootDSE\Global Software Library\Application Library\Microsoft" Remove-EmdbSoftwareCategory "Office 14" |
Alternatively, the code below removes the Static Software Category named "System-Tools" from the context "Global Software Library" using the Delete()-method:
$MySwCategory = Get-EmdbSoftwareCategory "emdb:\rootDSE\Global Software Library\System-Tools" $MySwCategory.Delete() |
Remove the Static Software Category named "Graphics Software" from the context "Global Software Library" using the cmdlet Remove-Item:
Remove-Item "emdb:\rootDSE\Global Software Library\Graphics Software" |
Hint: Alternatively the alias DEL can be used to remove Static Software Category objects. |
Starting with PSX 3.1 there was a new option implemented when deleting Software Category 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.