don't know the vicredentialstoreitem authentication. i'am connecting normally through an encrypted textfile which i push as input
maybe you could try it with that way? to see if it's a Problem with the Authentication.
Push an Passwort with:
####
$pwd = read-host -assecurestring:$true "Please enter"
$pwd | ConvertFrom-SecureString | Set-Content encrypted.txt
##
then push the script with:
$passwordenc = gc encrypted.txt |convertTo-secureString
$SSTU = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($passwordenc)
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($SSTU)
Import-Module VMware.VimAutomation.Extensions
$vCenter = "vcenter.host"
$dsFast1_1 = "naa.xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$dsFast1_2 = "naa.xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$host1 = "esx.host"
Connect-VIServer $vCenter -User xxxx -Password $password
$VMhost1 = Get-VMHost $host1
$SSDs = $VMhost1 | Get-VMHostDisk | Where {$_.ScsiLun.CanonicalName -contains $dsFast1_1 -or $_.ScsiLun.CanonicalName -contains $dsFast1_2}
$VMhost1 | Get-VMHostVFlashConfiguration | Set-VMHostVFlashConfiguration -AddDevice $SSDs
Disconnect-VIServer * -Confirm:$false
PS: if you like to encrypt both> you could create for user + password own encrypted files for inputing