DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Powershell Invoke-WebRequest  (Read 3,404 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Powershell Invoke-WebRequest
« on: September 23, 2021, 04:32 PM »
Hello!

I am not very familiar with the http terminology, what certificate, authentication, method, session, etc are.

I think in many cases, when you login to a website via a form, it creates a cookie based on which you keep your access to the site.

Which of the below (or other?) parameters should I need to specify to make PowerShell Invoke-WebRequest to behave like IE/Edge, i.e. to check and use whatever cookies and authentication has already taken place via the browser?

      [-WebSession <WebRequestSession>]
      [-SessionVariable <String>]
      [-AllowUnencryptedAuthentication]
      [-Authentication <WebAuthenticationType>]
      [-Credential <PSCredential>]
      [-UseDefaultCredentials]
      [-CertificateThumbprint <String>]
      [-Certificate <X509Certificate>]
      [-SkipCertificateCheck]
      [-SslProtocol <WebSslProtocol>]
      [-Token <SecureString>]
      [-Method <WebRequestMethod>]
      [-PreserveAuthorizationOnRedirect]
      [-SkipHeaderValidation]

Thanks!

Original address: https://www.donationcoder.com/forum/index.php?topic=51777.0