How to code it using Powershell Script?

Welcome Forums General PowerShell Q&A How to code it using Powershell Script?

This topic contains 1 reply, has 2 voices, and was last updated by

1 year ago.

  • Author
  • #91853

    Points: 0
    Rank: Member

    I would like to know on how to login using PowerShell, and what wrong is following coding?

    Does anyone have any suggestions?
    Thanks in advance for any suggestions

    HTML Coding

    #E-Mail *
    #Password *


    PowerShell Script
    $clnt = new-object System.Net.WebClient
    $URL = ""
    $token = "aaabbbcccjfheh48u8jdjd"
    $username = "sample_username"
    $password = "sample_password"
    $postParams = @{FORM_TOKEN=$token; LoginForm_email=$username; LoginForm_password=$password}
    Invoke-WebRequest -URi $URL -Method POST -body $postParams

  • #91907

    Points: 706
    Helping Hand
    Rank: Major Contributor

    What you are doing and asking about is s very common thing. You just have to make sure you are calling the objects of the fomr correctly.

    There are lots of examples of how to do this all over the web.

    For example:

    There are direct examples in the PoSH built-in help files ...

        # Get parameters, examples, full and Online help for a cmdlet or function
        (Get-Command -Name Invoke-WebRequest).Parameters
        Get-help -Name Invoke-WebRequest -Examples
        Get-help -Name Invoke-WebRequest -Full
        Get-help -Name Invoke-WebRequest -Online

    ... and sample scripts provide via the MS and the Scripting Guys blog.

    Automate login to website
    A script to log in to a website, parse the contents into objects, click some buttons and tick some checkboxes.

The topic ‘How to code it using Powershell Script?’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort