How to login gmail through powershell script?

I am trying to make powershell script to login gmail .I tried following code for username and password:
$ie.document.getElementById(“email”).value= “$username”
$ie.document.getElementById(“Passwd”).value = “$password”

Username field is working fine but password is not working with error:
The property ‘value’ can not be found on this object. Verify that the property exists and can be set.

Could you Please help me in this?


Have you gone through this post?