Invoke-Webrequest does not login to page

Hi All,

i am trying to log on to a website using POST, but unfortunatly i keep getting the login page as result.
i noticed that the $web.Forms[0].Action is empety so i entered the full Uri in the webrequest.
what am i doing wrong here ?

 

$web = Invoke-WebRequest -Uri 'https://vslangedijk.redlumy.nl/Identity/Account/Login' -SessionVariable session

$web.Forms[0].Fields.‘Input_Email’ = $U
$web.Forms[0].Fields.‘Input_Password’ = $P

$web2 = Invoke-WebRequest -Uri ‘Log in - RLPlanner’ -WebSession $session -Method POST -Body $web.Forms[0].Fields

 

somehow the forum added #8217; to my links instead of showing a ’