Hi Oliver g,
As mentioned above, you should add you credentials in a plain text format.
There are two ways to secure your login:
Option 1: add get-credentials in a variable that you could use in your script.
Option 2: ViCredentialstoreItem. This is a secure credential store from PowerCLI. Read more: Have you seen PowerCLI's "Credential Store" feature? - VMware PowerCLI Blog - VMware Blogs
If you need any help with it, just let me know.