locked
Getting messagebox whe Invoke-WebRequest RRS feed

  • Question

  • Hi,

    I am using Invoke-WebRequest to call a website with some parameters. Using the below code.

    Invoke-WebRequest -Uri "http://XXXXXXXX/XXXXX?abc=value" -Headers $headers.

    on the link if I click after the expected operation is done an alert box appears saying "The operation is done" with "OK" button. Similarly when I run the above command (Powershell) to invoke this link it stucked with the message box waiting to press OK button. I am not sure how to surpass this button. Please help.

    Thanks & Regards,
    Girish

    Wednesday, October 25, 2017 8:31 AM

All replies

  • You can't

    \_(ツ)_/

    Wednesday, October 25, 2017 9:09 AM
  • So is it like we cannot automate this?? any workaround you suggest?
    Wednesday, October 25, 2017 9:30 AM
  • Hi,

    I'm checking how the issue is going, was your issue resolved?

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best Regards,
    Albert Ling

    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, October 27, 2017 9:14 AM
  • if you don't use Invoke-WebRequest but IE you could do something like

    $ie = New-Object -COM InternetExplorer.Application
    $ie.Visible = $true
    $ie.Navigate("http://liblearn.osu.edu/tutor/jscript.html")

    Start-Sleep -Seconds 10

    $wshell = New-Object -ComObject wscript.shell
    $wshell.AppActivate($ie.Name)
    Start-Sleep -Milliseconds 500

    Add-Type -AssemblyName System.Windows.Forms
    [System.Windows.Forms.SendKeys]::SendWait('{ENTER}')
    Saturday, October 28, 2017 8:58 AM