Is there a (modern) way to connect to vCenter server securly without using files or passwords in clear text, when creating a scheduled task in Windows? Or is there some better way to store and schedule powercli scripts?
It's been a few years since I did this, and back in the day we used to store the password in a file (http://technodrone.blogspot.com/2012/05/creating-and-storing-powershell.html), but I doubt this is entirely without risk.
The "modern" way seem to be to use New-VICredentialStoreItem, to store it in but this comes with a pretty big caveat: -Password parameter is "string", so the password is also stored in powershell history which is not ideal. The tests I've done with Get-Credential and SecureString has not worked, but is there a way to not have them in the history in clear text?
Can't you somehow use the credentials specified when creating the scheduled task?