delete packages - UpendoVentures/Upendo-Dnn-Prompt GitHub Wiki

delete-packages

When used, this command will iterate through and delete the /App-Data/ExtensionPackages/ folder in your DNN instance.

Important Special Notes

  • This should not be done on any website that currently or may in the future support importing/exporting sites.
  • This should not be done on any website until AFTER a file system backup has occurred.

Since this folder can end up taking up a lot of disk space, resulting in larger and larger amounts of space needed for daily running and backup of the website.

If the site does not need these files, but you want to be thorough on keeping the file system clean, it's recommended that you first save those extension packages to a backed-up file share of some kind in your organization.

For more information about the background of this command, please see the list-packages command as well.

Command

Command Description
delete-packages Deletes all DNN extension packages in the /App_Data/ExtensionPackages/ folder.

Arguments

This prompt does not have any flags at this time.

Output

If successful, you'll see a message like below in the Prompt window.

When there are NO errors found*

Successfully deleted {0} of {1} files in the `/App_Data/ExtensionPackages/` folder.  

The placeholders would be replaced with the correct numbers found in the folder where the code was run.

When there are errors found*

Error Deleting: {0}  
Successfully deleted {0} of {1} files in the `/App_Data/ExtensionPackages/` folder.

The first line above would be seen once each for any file that could not be deleted. Sometimes, this is simply because of a Windows process or antivirus. Trying again may result in a successful message for the same file
The second line will be the same as before, but the successfully deleted number count will obviously reflect a lower number of successes.

If an error occurs, it should be displayed to you in the Prompt window. If not, you'll find it in the Log4net log files.

Additional Notes

This routine will only delete the extension packages. Any other files will still remain in the folder. The deleted files will be anything with the *.resources file extension. For example, if you have a file named anything else, like backup-file.zip, it will not be deleted.