i will check this on 2012 .
however for the credential following worked .however iamusing my domain pssword so it needs to be run once i reset my domin passord .
$path1 = 'C:\Users\user1\Desktop\folder1'
(get-credential).password | ConvertFrom-SecureString | set-content "$path\password.txt"
#it will store pssword in password.txt
$password = Get-Content "$path1\password.txt" | ConvertTo-SecureString
$credential = New-Object System.Management.Automation.PsCredential("domain\user1",$password)
connect-viserver -server vcentername -Credential $credential