Metasploit supports automations in different ways, one of which is resource scripts.
A resource script is basically a set of commands that run automatically when a script is loaded. Metasploit already contains a set of prebuilt scripts that are useful in corporate pentesting environments. The complete list of scripts that's available can be seen in the following directory:
/usr/share/metasploit-framework/scripts/resource# ls
The following screenshot shows the output of the preceding command: