As an aside, you can do this using Certify The Web https://certifytheweb.com (which I develop) using a Deployment Task: Deployment Tasks | Certify The Web Docs it can run powershell tasks etc (including basic impersonation/network credential etc).
Presumably you're specifically using certbot so you can get pem encoded cert files easily, in Certify The Web that would be a Deploy to Generic Server task, then set the output file paths for the components you want under Task Parameters. You can ask for further help over at https://community.certifytheweb.com/
If your main aim is automation of some larger process it's also worth looking at Posh-ACME, which is all powershell.
If you can provide the wider context for what you are trying to achieve we may be able to guide you in the right direction.