A
A
andreystrelkov2015-11-11 16:09:58
PowerShell
andreystrelkov, 2015-11-11 16:09:58

How to open a URL in Powershell and then close the browser?

Good afternoon, when I open a link using Powershell, let’s say the site’s cron opens a unique link, my browser opens as usual and everything is fine, but the browser remains open, so when the script is launched again on the shellduler, it opens another browser, then. their number increases and becomes not Feng Shui.
Is it possible to open a link without launching anything, i.e. can submit a request, or stupidly open through the browser and then after a while kill the browser process with a script?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ace_foster, 2015-11-12
@ace_foster

You can't download anything. Everything is accessible via PowerShell

$ie_procinfo = Start-Process iexplore -ArgumentList 'google.com' -passthru
$ie_procid = $ie_procinfo.id #сохраняем id запущеного процесса в переменную

Stop-Process -Id $ie_procid -Force # убиваем запущеный процесс по сохраненному id

A
azarij, 2015-11-19
@azarij

invoke-webrequest -uri <reference> -method get

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question