Removing Software Folders

Removes the specified Software Folder object(s).


Examples:


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


This one removes the Software Folder named "Oracle" from the context "Global Software Library\Application Library":


Remove-EmdbSoftwareFolder "emdb:\rootDSE\Global Software Library\Application Library\Oracle"


Hint: When trying to delete Software Folders that have child objects, like subfolders or Software Packages, using the Remove-EmdbSoftwareFolder cmdlet, an interactive confirmation dialog is displayed. In order to avoid this dialog to appear, the cmdlet must be used in conjunction with the -RecurseRemove switch.


The example below deletes the "Sage" folder and all its children from the current context:


Cd "emdb:\rootDSE\Global Software Library\Application Library"

Remove-EmdbSoftwareFolder "Sage" -RecurseRemove


Alternatively, the code below shows removing the Software Folder named "Global Software Library\Application Library\Citrix" using the method Delete():


$MySwFolder = Get-EmdbSoftwareFolder "emdb:\rootDSE\Global Software Library\Application Library\Citrix"

$MySwFolder.Delete()


Hint: Software Folders that have child objects can not be deleted using the method Delete(). In this case, the standard cmdlet Remove-Item parametrised with the switch parameter -Recurse has to be used. If the switch parameter is omitted, the PowerShell waits for an interactive confirmation of the deletion of every child object.


Remove the Software Folder named "Global Software Library\Application Library\Citrix" including its child objects using the cmdlet Remove-Item:


Remove-Item "emdb:\rootDSE\Global Software Library\Application Library\Citrix" -Recurse


Hint: Alternatively the alias DEL can be used to remove Software Folder objects.


Starting with PSX 3.1 there was a new option implemented when deleting Software Folder 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.