I believe the api has changed. No port required and username/password in json format.
$RestMethodParams = @{
'Method' = 'Post'
'URI' =  "$($URI)/rest/token"
'Body' = @{'username' = $Credentials.UserName; 'password' = $Credentials.GetNetworkCredential().password} | ConvertTo-Json -Compress
'ErrorVariable' = 'NessusLoginError'
}
        $TokenResponse = Invoke-RestMethod @RestMethodParams