To run a scheduled PS script against the vCenter server, you either hard code the credential in your script or use the credential file. Needless to say that credential file is better in terms of security, as the password is encrypted in the file.
Two steps to complete:
1) Create a credential file.
New-VICredentialStoreItem -host my-vcs-server -user jackie.chen -password ****** -file C:\Scripts\credfile.xml
2) Specify which credential file to use in the PS script.
$creds = Get-VICredentialStoreItem -file “C:\Scripts\credfile.xml”
Connect-viserver -Server $creds.Host -User $creds.User -Password $creds.Password