In the case of a simple script module, you may not necessarily need to handle module cleanup. However, when you write more complex modules, it is necessary that the module members be cleaned up when the module is removed.
Set up the cleanup of the custom module you created in the previous recipe, Writing a script module; simply write a host output stating that the module has been cleaned up. The cleanup should take place upon invoking Remove-Module. You also need to ensure that the the module cleanup happens, even if the PowerShell session is terminated without invoking Remove-Module.